Reverts TInputLine.GetData changes

This commit is contained in:
kagamma 2024-12-30 06:46:29 +00:00
parent c8958f3ab7
commit ef4a94541e

View File

@ -1626,21 +1626,20 @@ END;
{---------------------------------------------------------------------------}
PROCEDURE TInputLine.GetData (Var Rec);
BEGIN
{$ifdef FV_UNICODE}
{ We do not check for Data <> Sw_PString_Empty
in the Unicode version, or else this function
will always fail to get the data }
If (Validator = Nil) OR (Validator^.Transfer(Data Sw_PString_DeRef,
@Rec, vtGetData) = 0) Then
Sw_String(Rec) := Data;
{$else FV_UNICODE}
If Data <> Sw_PString_Empty Then Begin { Data ptr valid }
If (Validator = Nil) OR (Validator^.Transfer(Data Sw_PString_DeRef,
@Rec, vtGetData) = 0) Then Begin { No validator/data }
{$ifdef FV_UNICODE}
Sw_String(Rec):=Data;
{$else FV_UNICODE}
FillChar(Rec, DataSize, #0); { Clear the data area }
Move(Data^, Rec, Length(Data^) + 1); { Transfer our data }
{$endif FV_UNICODE}
End;
End Else
{$ifdef FV_UNICODE}
Sw_String(Rec):='';
{$else FV_UNICODE}
FillChar(Rec, DataSize, #0); { Clear the data area }
{$endif FV_UNICODE}
END;