mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 11:49:23 +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;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
procedure SetFieldType(AValue: TFieldType); override;
|
||||
property FixedChar : Boolean read FFixedChar write FFixedChar;
|
||||
property Transliterate: Boolean read FTransliterate write FTransliterate;
|
||||
property Value: String read GetAsString write SetAsString;
|
||||
|
@ -1006,6 +1006,12 @@ begin
|
||||
FSize:=20;
|
||||
end;
|
||||
|
||||
procedure TStringField.SetFieldType(AValue: TFieldType);
|
||||
begin
|
||||
if avalue in [ftString, ftFixedChar] then
|
||||
SetDataType(AValue);
|
||||
end;
|
||||
|
||||
class procedure TStringField.CheckTypeSize(AValue: Longint);
|
||||
|
||||
begin
|
||||
@ -1065,7 +1071,10 @@ end;
|
||||
function TStringField.GetDataSize: Integer;
|
||||
|
||||
begin
|
||||
Result:=Size+1;
|
||||
if DataType=ftFixedChar then
|
||||
Result:=Size
|
||||
else
|
||||
Result:=Size+1;
|
||||
end;
|
||||
|
||||
function TStringField.GetDefaultWidth: Longint;
|
||||
|
Loading…
Reference in New Issue
Block a user