* Patch from Ladislav Karrach (Lacak2) to implement TBooleanField.AsInteger, bug #14751

git-svn-id: trunk@15206 -
This commit is contained in:
joost 2010-05-02 16:26:41 +00:00
parent b7dc7d03b2
commit ac2cd091e9
2 changed files with 15 additions and 0 deletions

View File

@ -664,10 +664,12 @@ type
function GetAsBoolean: Boolean; override;
function GetAsString: string; override;
function GetAsVariant: variant; override;
function GetAsInteger: Longint; override;
function GetDataSize: Integer; override;
function GetDefaultWidth: Longint; override;
procedure SetAsBoolean(AValue: Boolean); override;
procedure SetAsString(const AValue: string); override;
procedure SetAsInteger(AValue: Integer); override;
procedure SetVarValue(const AValue: Variant); override;
public
constructor Create(AOwner: TComponent); override;

View File

@ -1920,6 +1920,19 @@ begin
Result:=Length(FDisplays[false,True]);
end;
function TBooleanField.GetAsInteger: integer;
begin
if GetAsBoolean then
Result:=1
else
Result:=0;
end;
procedure TBooleanField.SetAsInteger(AValue: Integer);
begin
SetAsBoolean(avalue<>0);
end;
procedure TBooleanField.SetAsBoolean(AValue: Boolean);
var b : wordbool;