mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 12:29:25 +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 SetSize(const AValue: Word);
|
||||||
procedure SetRequired(const AValue: Boolean);
|
procedure SetRequired(const AValue: Boolean);
|
||||||
public
|
public
|
||||||
|
constructor create(ACollection : TCollection); overload;
|
||||||
constructor Create(AOwner: TFieldDefs; const AName: string;
|
constructor Create(AOwner: TFieldDefs; const AName: string;
|
||||||
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint); overload;
|
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint); overload;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
@ -28,6 +28,13 @@ end;}
|
|||||||
TFieldDef
|
TFieldDef
|
||||||
---------------------------------------------------------------------}
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
|
Constructor TFieldDef.Create(ACollection : TCollection);
|
||||||
|
|
||||||
|
begin
|
||||||
|
Inherited create(ACollection);
|
||||||
|
FFieldNo:=Index+1;
|
||||||
|
end;
|
||||||
|
|
||||||
Constructor TFieldDef.Create(AOwner: TFieldDefs; const AName: string;
|
Constructor TFieldDef.Create(AOwner: TFieldDefs; const AName: string;
|
||||||
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint);
|
ADataType: TFieldType; ASize: Word; ARequired: Boolean; AFieldNo: Longint);
|
||||||
|
|
||||||
@ -236,7 +243,8 @@ procedure TFieldDefs.Update;
|
|||||||
begin
|
begin
|
||||||
if not Updated then
|
if not Updated then
|
||||||
begin
|
begin
|
||||||
DataSet.InitFieldDefs;
|
If Assigned(Dataset) then
|
||||||
|
DataSet.InitFieldDefs;
|
||||||
Updated := True;
|
Updated := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user