From bad57b7741633345824b7c791838e05fb9dffbcd Mon Sep 17 00:00:00 2001 From: joost Date: Mon, 28 Feb 2005 16:19:07 +0000 Subject: [PATCH] - Boolean fields are wordbool's now --- fcl/db/bufdataset.inc | 2 +- fcl/db/fields.inc | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/fcl/db/bufdataset.inc b/fcl/db/bufdataset.inc index 10559b9469..6af715ff9d 100644 --- a/fcl/db/bufdataset.inc +++ b/fcl/db/bufdataset.inc @@ -327,7 +327,7 @@ begin ftSmallint, ftInteger, ftword : result := sizeof(longint); - ftBoolean : result := sizeof(boolean); + ftBoolean : result := sizeof(wordbool); ftBCD : result := sizeof(currency); ftFloat : result := sizeof(double); ftTime, diff --git a/fcl/db/fields.inc b/fcl/db/fields.inc index d760c50e4a..ee2e2eff23 100644 --- a/fcl/db/fields.inc +++ b/fcl/db/fields.inc @@ -877,7 +877,6 @@ end; function TLongintField.GetAsVariant: Variant; Var L : Longint; -v : variant; begin If GetValue(L) then @@ -1344,14 +1343,18 @@ end; function TBooleanField.GetAsBoolean: Boolean; +var b : wordbool; + begin - If not GetData(@Result) then + If GetData(@b) then + result := b + else Result:=False; end; function TBooleanField.GetAsVariant: Variant; -Var b : boolean; +Var b : wordbool; begin If GetData(@b) then @@ -1362,7 +1365,7 @@ end; function TBooleanField.GetAsString: string; -Var B : boolean; +Var B : wordbool; begin If Getdata(@B) then @@ -1374,7 +1377,7 @@ end; function TBooleanField.GetDataSize: Word; begin - Result:=SizeOf(Boolean); + Result:=SizeOf(wordBool); end; function TBooleanField.GetDefaultWidth: Longint; @@ -1387,8 +1390,11 @@ end; procedure TBooleanField.SetAsBoolean(AValue: Boolean); +var b : wordbool; + begin - SetData(@AValue); + b := AValue; + SetData(@b); end; procedure TBooleanField.SetAsString(const AValue: string); @@ -2192,7 +2198,10 @@ end; { $Log$ - Revision 1.24 2005-02-16 09:31:58 michael + Revision 1.25 2005-02-28 16:19:07 joost + - Boolean fields are wordbool's now + + 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