mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 17:09:10 +02:00
* Added ftFixedChar as possible datatype for TStringFields
* The buffer from a TStringField does not nead a #0 suffix when the datatype is ftFixedChar git-svn-id: trunk@13406 -
This commit is contained in:
parent
d837f6d83e
commit
a0f0e8d5d5
@ -467,6 +467,7 @@ type
|
|||||||
procedure SetVarValue(const AValue: Variant); override;
|
procedure SetVarValue(const AValue: Variant); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
|
procedure SetFieldType(AValue: TFieldType); override;
|
||||||
property FixedChar : Boolean read FFixedChar write FFixedChar;
|
property FixedChar : Boolean read FFixedChar write FFixedChar;
|
||||||
property Transliterate: Boolean read FTransliterate write FTransliterate;
|
property Transliterate: Boolean read FTransliterate write FTransliterate;
|
||||||
property Value: String read GetAsString write SetAsString;
|
property Value: String read GetAsString write SetAsString;
|
||||||
|
@ -1006,6 +1006,12 @@ begin
|
|||||||
FSize:=20;
|
FSize:=20;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TStringField.SetFieldType(AValue: TFieldType);
|
||||||
|
begin
|
||||||
|
if avalue in [ftString, ftFixedChar] then
|
||||||
|
SetDataType(AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TStringField.CheckTypeSize(AValue: Longint);
|
class procedure TStringField.CheckTypeSize(AValue: Longint);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -1065,7 +1071,10 @@ end;
|
|||||||
function TStringField.GetDataSize: Integer;
|
function TStringField.GetDataSize: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=Size+1;
|
if DataType=ftFixedChar then
|
||||||
|
Result:=Size
|
||||||
|
else
|
||||||
|
Result:=Size+1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TStringField.GetDefaultWidth: Longint;
|
function TStringField.GetDefaultWidth: Longint;
|
||||||
|
Loading…
Reference in New Issue
Block a user