mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 07:28:26 +02:00
* Allow Nil owner for TFieldDefs (.Update method)
* TFieldDef.Create override, initializes FFieldNo. Fixes MemDS streaming issue. git-svn-id: trunk@8356 -
This commit is contained in:
parent
19f4e1e9f6
commit
825ac6ebe4
@ -182,6 +182,7 @@ type
|
||||
procedure SetSize(const AValue: Word);
|
||||
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;
|
||||
destructor Destroy; override;
|
||||
|
@ -28,6 +28,13 @@ end;}
|
||||
TFieldDef
|
||||
---------------------------------------------------------------------}
|
||||
|
||||
Constructor TFieldDef.Create(ACollection : TCollection);
|
||||
|
||||
begin
|
||||
Inherited create(ACollection);
|
||||
FFieldNo:=Index+1;
|
||||
end;
|
||||
|
||||
Constructor TFieldDef.Create(AOwner: TFieldDefs; const AName: string;
|
||||
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint);
|
||||
|
||||
@ -236,7 +243,8 @@ procedure TFieldDefs.Update;
|
||||
begin
|
||||
if not Updated then
|
||||
begin
|
||||
DataSet.InitFieldDefs;
|
||||
If Assigned(Dataset) then
|
||||
DataSet.InitFieldDefs;
|
||||
Updated := True;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user