* 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:
joost 2009-07-18 12:36:36 +00:00
parent d837f6d83e
commit a0f0e8d5d5
2 changed files with 11 additions and 1 deletions

View File

@ -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;

View File

@ -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;