mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 12:19:18 +02:00
parent
8ec185eb10
commit
5f0bd73dec
@ -1052,20 +1052,26 @@ end;
|
|||||||
|
|
||||||
procedure TStringField.SetAsString(const AValue: string);
|
procedure TStringField.SetAsString(const AValue: string);
|
||||||
|
|
||||||
Const NullByte : char = #0;
|
|
||||||
|
|
||||||
var Buf : TStringFieldBuffer;
|
var Buf : TStringFieldBuffer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
IF Length(AValue)=0 then
|
IF Length(AValue)=0 then
|
||||||
SetData(@NullByte)
|
begin
|
||||||
|
Buf := #0;
|
||||||
|
SetData(@buf);
|
||||||
|
end
|
||||||
else if FTransliterate then
|
else if FTransliterate then
|
||||||
begin
|
begin
|
||||||
DataSet.Translate(@AValue[1],Buf,True);
|
DataSet.Translate(@AValue[1],Buf,True);
|
||||||
SetData(@buf);
|
SetData(@buf);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
SetData(@AValue[1]);
|
begin
|
||||||
|
// The data is copied into the buffer, since some TDataset descendents copy
|
||||||
|
// the whole buffer-length in SetData. (See bug 8477)
|
||||||
|
Buf := AValue;
|
||||||
|
SetData(@Buf);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TStringField.SetVarValue(const AValue: Variant);
|
procedure TStringField.SetVarValue(const AValue: Variant);
|
||||||
|
Loading…
Reference in New Issue
Block a user