* Changed TFieldDef.Size, TField.Size and TField.DataSize from word to integer. Delphi compatible, reported by Paul Ishenin

git-svn-id: trunk@12268 -
This commit is contained in:
joost 2008-11-29 12:18:46 +00:00
parent af7b064157
commit 3bc585684b
2 changed files with 37 additions and 37 deletions

View File

@ -173,18 +173,18 @@ type
FInternalCalcField : Boolean;
FPrecision : Longint;
FRequired : Boolean;
FSize : Word;
FSize : Integer;
FAttributes : TFieldAttributes;
Function GetFieldClass : TFieldClass;
procedure SetAttributes(AValue: TFieldAttributes);
procedure SetDataType(AValue: TFieldType);
procedure SetPrecision(const AValue: Longint);
procedure SetSize(const AValue: Word);
procedure SetSize(const AValue: Integer);
procedure SetRequired(const AValue: Boolean);
public
constructor create(ACollection : TCollection); overload;
constructor Create(AOwner: TFieldDefs; const AName: string;
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint); overload;
ADataType: TFieldType; ASize: Integer; ARequired: Boolean; AFieldNo: Longint); overload;
destructor Destroy; override;
procedure Assign(APersistent: TPersistent); override;
function CreateField(AOwner: TComponent): TField;
@ -196,7 +196,7 @@ type
property Attributes: TFieldAttributes read FAttributes write SetAttributes default [];
property DataType: TFieldType read FDataType write SetDataType;
property Precision: Longint read FPrecision write SetPrecision;
property Size: Word read FSize write SetSize;
property Size: Integer read FSize write SetSize;
end;
{ TFieldDefs }
@ -290,7 +290,7 @@ type
FOrigin : String;
FReadOnly : Boolean;
FRequired : Boolean;
FSize : Word;
FSize : integer;
FValidChars : TFieldChars;
FValueBuffer : Pointer;
FValidating : Boolean;
@ -333,7 +333,7 @@ type
function GetAsWideString: WideString; virtual;
function GetCanModify: Boolean; virtual;
function GetClassDesc: String; virtual;
function GetDataSize: Word; virtual;
function GetDataSize: Integer; virtual;
function GetDefaultWidth: Longint; virtual;
function GetDisplayName : String;
function GetCurValue: Variant; virtual;
@ -359,7 +359,7 @@ type
procedure SetDataset(AValue : TDataset); virtual;
procedure SetDataType(AValue: TFieldType);
procedure SetNewValue(const AValue: Variant);
procedure SetSize(AValue: Word); virtual;
procedure SetSize(AValue: Integer); virtual;
procedure SetParentComponent(AParent: TComponent); override;
procedure SetText(const AValue: string); virtual;
procedure SetVarValue(const AValue: Variant); virtual;
@ -395,7 +395,7 @@ type
property CanModify: Boolean read GetCanModify;
property CurValue: Variant read GetCurValue;
property DataSet: TDataSet read FDataSet write SetDataSet;
property DataSize: Word read GetDataSize;
property DataSize: Integer read GetDataSize;
property DataType: TFieldType read FDataType;
property DisplayName: String Read GetDisplayName;
property DisplayText: String read GetDisplayText;
@ -404,7 +404,7 @@ type
property IsNull: Boolean read GetIsNull;
property NewValue: Variant read GetNewValue write SetNewValue;
property Offset: word read FOffset;
property Size: Word read FSize write SetSize;
property Size: Integer read FSize write SetSize;
property Text: string read GetEditText write SetEditText;
property ValidChars : TFieldChars Read FValidChars;
property Value: variant read GetAsVariant write SetAsVariant;
@ -453,7 +453,7 @@ type
function GetAsLongint: Longint; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
function GetDefaultWidth: Longint; override;
procedure GetText(var AText: string; ADisplayText: Boolean); override;
function GetValue(var AValue: string): Boolean;
@ -489,7 +489,7 @@ type
function GetAsWideString: WideString; override;
procedure SetAsWideString(const aValue: WideString); override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
public
constructor Create(aOwner: TComponent); override;
property Value: WideString read GetAsWideString write SetAsWideString;
@ -530,7 +530,7 @@ type
function GetAsLongint: Longint; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
procedure GetText(var AText: string; ADisplayText: Boolean); override;
function GetValue(var AValue: Longint): Boolean;
procedure SetAsFloat(AValue: Double); override;
@ -563,7 +563,7 @@ type
function GetAsLargeint: Largeint; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
procedure GetText(var AText: string; ADisplayText: Boolean); override;
function GetValue(var AValue: Largeint): Boolean;
procedure SetAsFloat(AValue: Double); override;
@ -584,7 +584,7 @@ type
TSmallintField = class(TLongintField)
protected
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
public
constructor Create(AOwner: TComponent); override;
end;
@ -593,7 +593,7 @@ type
TWordField = class(TLongintField)
protected
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
public
constructor Create(AOwner: TComponent); override;
end;
@ -621,7 +621,7 @@ type
function GetAsLongint: Longint; override;
function GetAsVariant: variant; override;
function GetAsString: string; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
procedure GetText(var theText: string; ADisplayText: Boolean); override;
procedure SetAsFloat(AValue: Double); override;
procedure SetAsLongint(AValue: Longint); override;
@ -660,7 +660,7 @@ type
function GetAsBoolean: Boolean; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
function GetDefaultWidth: Longint; override;
procedure SetAsBoolean(AValue: Boolean); override;
procedure SetAsString(const AValue: string); override;
@ -683,7 +683,7 @@ type
function GetAsFloat: Double; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
procedure GetText(var theText: string; ADisplayText: Boolean); override;
procedure SetAsDateTime(AValue: TDateTime); override;
procedure SetAsFloat(AValue: Double); override;
@ -732,7 +732,7 @@ type
TBytesField = class(TBinaryField)
protected
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
public
constructor Create(AOwner: TComponent); override;
end;
@ -741,7 +741,7 @@ type
TVarBytesField = class(TBytesField)
protected
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
public
constructor Create(AOwner: TComponent); override;
end;
@ -762,7 +762,7 @@ type
function GetAsString: string; override;
function GetValue(var AValue: Currency): Boolean;
function GetAsVariant: variant; override;
function GetDataSize: Word; override;
function GetDataSize: Integer; override;
function GetDefaultWidth: Longint; override;
procedure GetText(var TheText: string; ADisplayText: Boolean); override;
procedure SetAsFloat(AValue: Double); override;

View File

@ -36,7 +36,7 @@ begin
end;
Constructor TFieldDef.Create(AOwner: TFieldDefs; const AName: string;
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint);
ADataType: TFieldType; ASize: Integer; ARequired: Boolean; AFieldNo: Longint);
begin
{$ifdef dsdebug }
@ -138,7 +138,7 @@ begin
Changed(False);
end;
procedure TFieldDef.SetSize(const AValue: Word);
procedure TFieldDef.SetSize(const AValue: Integer);
begin
FSize := AValue;
Changed(False);
@ -564,7 +564,7 @@ begin
Result:=FDataset.GetFieldData(Self,Buffer,NativeFormat);
end;
function TField.GetDataSize: Word;
function TField.GetDataSize: Integer;
begin
Result:=0;
@ -860,7 +860,7 @@ begin
DataSet := AParent as TDataSet;
end;
procedure TField.SetSize(AValue: Word);
procedure TField.SetSize(AValue: Integer);
begin
CheckInactive;
@ -1058,7 +1058,7 @@ begin
end;
function TStringField.GetDataSize: Word;
function TStringField.GetDataSize: Integer;
begin
Result:=Size+1;
@ -1234,7 +1234,7 @@ begin
SetData(Buffer, False);
end;
function TWideStringField.GetDataSize: Word;
function TWideStringField.GetDataSize: Integer;
begin
Result :=
(Size + 1) * 2;
@ -1343,7 +1343,7 @@ begin
Result:='';
end;
function TLongintField.GetDataSize: Word;
function TLongintField.GetDataSize: Integer;
begin
Result:=SizeOf(Longint);
@ -1513,7 +1513,7 @@ begin
Result:='';
end;
function TLargeintField.GetDataSize: Word;
function TLargeintField.GetDataSize: Integer;
begin
Result:=SizeOf(Largeint);
@ -1632,7 +1632,7 @@ end;
{ TSmallintField }
function TSmallintField.GetDataSize: Word;
function TSmallintField.GetDataSize: Integer;
begin
Result:=SizeOf(SmallInt);
@ -1650,7 +1650,7 @@ end;
{ TWordField }
function TWordField.GetDataSize: Word;
function TWordField.GetDataSize: Integer;
begin
Result:=SizeOf(Word);
@ -1725,7 +1725,7 @@ begin
Result:='';
end;
function TFloatField.GetDataSize: Word;
function TFloatField.GetDataSize: Integer;
begin
Result:=SizeOf(Double);
@ -1865,7 +1865,7 @@ begin
result:='';
end;
function TBooleanField.GetDataSize: Word;
function TBooleanField.GetDataSize: Integer;
begin
Result:=SizeOf(wordBool);
@ -1984,7 +1984,7 @@ begin
end;
function TDateTimeField.GetDataSize: Word;
function TDateTimeField.GetDataSize: Integer;
begin
Result:=SizeOf(TDateTime);
@ -2145,7 +2145,7 @@ end;
{ TBytesField }
function TBytesField.GetDataSize: Word;
function TBytesField.GetDataSize: Integer;
begin
Result:=Size;
@ -2164,7 +2164,7 @@ end;
{ TVarBytesField }
function TVarBytesField.GetDataSize: Word;
function TVarBytesField.GetDataSize: Integer;
begin
Result:=Size+2;
@ -2237,7 +2237,7 @@ begin
Result := GetData(@AValue);
end;
function TBCDField.GetDataSize: Word;
function TBCDField.GetDataSize: Integer;
begin
result := sizeof(system.currency);