* 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:
michael 2007-09-02 16:27:00 +00:00
parent 19f4e1e9f6
commit 825ac6ebe4
2 changed files with 10 additions and 1 deletions

View File

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

View File

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