Sfoglia il codice sorgente

fcl-db: dbase: add new field types (ftLongWord, ftShortint, ftByte) to fix export test errors

git-svn-id: trunk@47225 -
lacak 4 anni fa
parent
commit
eb4bc9d153

+ 1 - 0
packages/fcl-db/src/dbase/dbf_common.inc

@@ -223,6 +223,7 @@
   {$define SUPPORT_SEPARATE_VARIANTS_UNIT}
   {$define SUPPORT_REFRESHEVENTS}
   {$define SUPPORT_BACKWARD_FIELDDATA}
+  {$define SUPPORT_LONGWORD}
 
   // FPC 1.0.x exceptions: no 0/0 support
   {$ifdef VER1_0}

+ 17 - 0
packages/fcl-db/src/dbase/dbf_fields.pas

@@ -177,6 +177,7 @@ database.
   DIGITS_WORD = 5;
   DIGITS_INTEGER = 9;
   DIGITS_LARGEINT = 18;
+  DIGITS_LONGWORD = 9;
 
 //====================================================================
 // DbfFieldDefs
@@ -474,6 +475,9 @@ begin
     ftFloat, ftSmallInt, ftWord
 {$ifdef SUPPORT_INT64}
       , ftLargeInt
+{$endif}
+{$ifdef SUPPORT_LONGWORD}
+      , ftLongWord, ftShortInt, ftByte
 {$endif}
                :
       FNativeFieldType := 'N'; //numerical
@@ -559,6 +563,19 @@ begin
         FSize := DIGITS_LARGEINT;
         FPrecision := 0;
       end;
+{$endif}
+{$ifdef SUPPORT_LONGWORD}
+    ftLongWord:
+      begin
+        FSize := DIGITS_LONGWORD;
+        FPrecision := 0;
+      end;
+    ftShortInt,
+    ftByte:
+      begin
+        FSize := 3;
+        FPrecision := 0;
+      end;
 {$endif}
     ftString {$ifdef SUPPORT_FIELDTYPES_V4}, ftFixedChar, ftWideString{$endif}:
       begin