- Remove TTimeField and TDateField GetDataSize functions since both are exactly

equal to their ancestor: TDateTimeField.GetDataSize
- TAutoInc fields are set to ReadyOnly on create
- In TFieldDef.CreateField the presence of faReadyOnly in Attributes is respected
This commit is contained in:
michael 2005-02-16 09:31:58 +00:00
parent bc0c22df82
commit fea9565cca
2 changed files with 17 additions and 21 deletions

View File

@ -541,8 +541,6 @@ type
{ TDateField } { TDateField }
TDateField = class(TDateTimeField) TDateField = class(TDateTimeField)
protected
function GetDataSize: Word; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
end; end;
@ -550,8 +548,6 @@ type
{ TTimeField } { TTimeField }
TTimeField = class(TDateTimeField) TTimeField = class(TDateTimeField)
protected
function GetDataSize: Word; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
end; end;
@ -1846,7 +1842,13 @@ end.
{ {
$Log$ $Log$
Revision 1.37 2005-02-14 17:13:12 peter Revision 1.38 2005-02-16 09:31:58 michael
- Remove TTimeField and TDateField GetDataSize functions since both are exactly
equal to their ancestor: TDateTimeField.GetDataSize
- TAutoInc fields are set to ReadyOnly on create
- In TFieldDef.CreateField the presence of faReadyOnly in Attributes is respected
Revision 1.37 2005/02/14 17:13:12 peter
* truncate log * truncate log
Revision 1.36 2005/02/07 11:21:50 joost Revision 1.36 2005/02/07 11:21:50 joost

View File

@ -82,6 +82,7 @@ begin
Result.FDisplayLabel:=FDisplayName; Result.FDisplayLabel:=FDisplayName;
Result.FFieldNo:=Self.FieldNo; Result.FFieldNo:=Self.FieldNo;
Result.SetFieldType(DataType); Result.SetFieldType(DataType);
Result.FReadOnly:= (faReadOnly in Attributes);
{$ifdef dsdebug} {$ifdef dsdebug}
Writeln ('TFieldDef.CReateField : Trying to set dataset'); Writeln ('TFieldDef.CReateField : Trying to set dataset');
{$endif dsdebug} {$endif dsdebug}
@ -1222,6 +1223,7 @@ constructor TAutoIncField.Create(AOwner: TComponent);
begin begin
Inherited Create(AOWner); Inherited Create(AOWner);
SetDataType(ftAutoInc); SetDataType(ftAutoInc);
FReadOnly:=True;
end; end;
Procedure TAutoIncField.SetAsLongint(AValue : Longint); Procedure TAutoIncField.SetAsLongint(AValue : Longint);
@ -1528,15 +1530,9 @@ begin
SetDataType(ftDateTime); SetDataType(ftDateTime);
end; end;
{ TDateField } { TDateField }
function TDateField.GetDataSize: Word;
begin
Result:=SizeOf(TDateTime);
end;
constructor TDateField.Create(AOwner: TComponent); constructor TDateField.Create(AOwner: TComponent);
begin begin
@ -1545,16 +1541,8 @@ begin
end; end;
{ TTimeField } { TTimeField }
function TTimeField.GetDataSize: Word;
begin
Result:=SizeOf(TDateTime);
end;
constructor TTimeField.Create(AOwner: TComponent); constructor TTimeField.Create(AOwner: TComponent);
begin begin
@ -2204,7 +2192,13 @@ end;
{ {
$Log$ $Log$
Revision 1.23 2005-02-14 17:13:12 peter Revision 1.24 2005-02-16 09:31:58 michael
- Remove TTimeField and TDateField GetDataSize functions since both are exactly
equal to their ancestor: TDateTimeField.GetDataSize
- TAutoInc fields are set to ReadyOnly on create
- In TFieldDef.CreateField the presence of faReadyOnly in Attributes is respected
Revision 1.23 2005/02/14 17:13:12 peter
* truncate log * truncate log
Revision 1.22 2005/02/07 11:22:23 joost Revision 1.22 2005/02/07 11:22:23 joost