Browse Source

* aslargeint for TLongintfield, mantis #18287, patch by Lacak2

git-svn-id: trunk@18989 -
marco 14 years ago
parent
commit
3e8a3eb14c
2 changed files with 15 additions and 0 deletions
  1. 2 0
      packages/fcl-db/src/base/db.pas
  2. 13 0
      packages/fcl-db/src/base/fields.inc

+ 2 - 0
packages/fcl-db/src/base/db.pas

@@ -546,6 +546,8 @@ type
     procedure SetAsLongint(AValue: Longint); override;
     procedure SetAsString(const AValue: string); override;
     procedure SetVarValue(const AValue: Variant); override;
+    function GetAsLargeint: Largeint; override;
+    procedure SetAsLargeint(AValue: Largeint); override;
   public
     constructor Create(AOwner: TComponent); override;
     Function CheckRange(AValue : longint) : Boolean;

+ 13 - 0
packages/fcl-db/src/base/fields.inc

@@ -1363,6 +1363,11 @@ begin
   Result:=GetAsLongint;
 end;
 
+function TLongintField.GetAsLargeint: Largeint;
+begin
+  Result:=GetAsLongint;
+end;
+
 function TLongintField.GetAsLongint: Longint;
 
 begin
@@ -1432,6 +1437,14 @@ begin
     end;
 end;
 
+procedure TLongintField.SetAsLargeint(AValue: Largeint);
+begin
+  if (AValue>=FMinRange) and (AValue<=FMaxRange) then
+    SetAsLongint(AValue)
+  else
+    RangeError(AValue,FMinRange,FMaxRange);
+end;
+
 procedure TLongintField.SetAsFloat(AValue: Double);
 
 begin