Browse Source

tdbf cvs updates

git-svn-id: trunk@3459 -
micha 19 years ago
parent
commit
05f8a1abc3

+ 9 - 11
fcl/db/dbase/dbf.pas

@@ -170,7 +170,6 @@ type
     FTableLevel: Integer;
     FTableLevel: Integer;
     FExclusive: Boolean;
     FExclusive: Boolean;
     FShowDeleted: Boolean;
     FShowDeleted: Boolean;
-    FUseFloatFields: Boolean;
     FPosting: Boolean;
     FPosting: Boolean;
     FDisableResyncOnPost: Boolean;
     FDisableResyncOnPost: Boolean;
     FTempExclusive: Boolean;
     FTempExclusive: Boolean;
@@ -403,7 +402,6 @@ type
     property StoreDefs: Boolean read FStoreDefs write FStoreDefs default False;
     property StoreDefs: Boolean read FStoreDefs write FStoreDefs default False;
     property TableName: string read FTableName write SetTableName;
     property TableName: string read FTableName write SetTableName;
     property TableLevel: Integer read FTableLevel write SetTableLevel;
     property TableLevel: Integer read FTableLevel write SetTableLevel;
-    property UseFloatFields: Boolean read FUseFloatFields write FUseFloatFields;
       (* default {$ifdef SUPPORT_INT64} false {$else} true {$endif}; *)
       (* default {$ifdef SUPPORT_INT64} false {$else} true {$endif}; *)
     property Version: string read GetVersion write SetVersion stored false;
     property Version: string read GetVersion write SetVersion stored false;
     property BeforeAutoCreate: TBeforeAutoCreateEvent read FBeforeAutoCreate write FBeforeAutoCreate;
     property BeforeAutoCreate: TBeforeAutoCreateEvent read FBeforeAutoCreate write FBeforeAutoCreate;
@@ -626,8 +624,6 @@ begin
   FPosting := false;
   FPosting := false;
   FReadOnly := false;
   FReadOnly := false;
   FExclusive := false;
   FExclusive := false;
-  FUseFloatFields := true;
-  //FUseFloatFields := {$ifdef SUPPORT_INT64} false {$else} true {$endif};
   FDisableResyncOnPost := false;
   FDisableResyncOnPost := false;
   FTempExclusive := false;
   FTempExclusive := false;
   FCopyDateTimeAsString := false;
   FCopyDateTimeAsString := false;
@@ -1042,7 +1038,6 @@ begin
     FDbfFile.Mode := FileOpenMode;
     FDbfFile.Mode := FileOpenMode;
   end;
   end;
   FDbfFile.AutoCreate := false;
   FDbfFile.AutoCreate := false;
-  FDbfFile.UseFloatFields := FUseFloatFields;
   FDbfFile.DateTimeHandling := FDateTimeHandling;
   FDbfFile.DateTimeHandling := FDateTimeHandling;
   FDbfFile.OnLocaleError := FOnLocaleError;
   FDbfFile.OnLocaleError := FOnLocaleError;
   FDbfFile.OnIndexMissing := FOnIndexMissing;
   FDbfFile.OnIndexMissing := FOnIndexMissing;
@@ -1401,7 +1396,6 @@ begin
       begin
       begin
         ADbfFieldDefs := TDbfFieldDefs.Create(Self);
         ADbfFieldDefs := TDbfFieldDefs.Create(Self);
         ADbfFieldDefs.DbfVersion := TableLevelToDbfVersion(FTableLevel);
         ADbfFieldDefs.DbfVersion := TableLevelToDbfVersion(FTableLevel);
-        ADbfFieldDefs.UseFloatFields := FUseFloatFields;
 
 
         // get fields -> fielddefs if no fielddefs
         // get fields -> fielddefs if no fielddefs
 {$ifndef FPC_VERSION}
 {$ifndef FPC_VERSION}
@@ -2139,11 +2133,15 @@ function TDbf.GetRecNo: Integer; {override virtual}
 var
 var
   pBuffer: pointer;
   pBuffer: pointer;
 begin
 begin
-  if State = dsCalcFields then
-    pBuffer := CalcBuffer
-  else
-    pBuffer := ActiveBuffer;
-  Result := pDbfRecord(pBuffer)^.SequentialRecNo;
+  if FCursor <> nil then
+  begin
+    if State = dsCalcFields then
+      pBuffer := CalcBuffer
+    else
+      pBuffer := ActiveBuffer;
+    Result := pDbfRecord(pBuffer)^.SequentialRecNo;
+  end else
+    Result := 0;
 end;
 end;
 
 
 procedure TDbf.SetRecNo(Value: Integer); {override virtual}
 procedure TDbf.SetRecNo(Value: Integer); {override virtual}

+ 1 - 1
fcl/db/dbase/dbf_common.pas

@@ -17,7 +17,7 @@ uses
 
 
 const
 const
   TDBF_MAJOR_VERSION      = 6;
   TDBF_MAJOR_VERSION      = 6;
-  TDBF_MINOR_VERSION      = 48;
+  TDBF_MINOR_VERSION      = 49;
   TDBF_SUB_MINOR_VERSION  = 0;
   TDBF_SUB_MINOR_VERSION  = 0;
 
 
   TDBF_TABLELEVEL_FOXPRO = 25;
   TDBF_TABLELEVEL_FOXPRO = 25;

+ 1 - 1
fcl/db/dbase/dbf_dbffile.pas

@@ -875,7 +875,7 @@ begin
 
 
       // apply field transformation tricks
       // apply field transformation tricks
       if (lNativeFieldType = 'C') 
       if (lNativeFieldType = 'C') 
-{$ifdef USE_LONG_CHAR_FIELDS}
+{$ifndef USE_LONG_CHAR_FIELDS}
           and (FDbfVersion = xFoxPro) 
           and (FDbfVersion = xFoxPro) 
 {$endif}
 {$endif}
                 then
                 then

+ 2 - 7
fcl/db/dbase/dbf_fields.pas

@@ -84,7 +84,6 @@ type
   private
   private
     FOwner: TPersistent;
     FOwner: TPersistent;
     FDbfVersion: TXBaseVersion;
     FDbfVersion: TXBaseVersion;
-    FUseFloatFields: Boolean;
 
 
     function GetItem(Idx: Integer): TDbfFieldDef;
     function GetItem(Idx: Integer): TDbfFieldDef;
   protected
   protected
@@ -101,7 +100,6 @@ type
 
 
     property Items[Idx: Integer]: TDbfFieldDef read GetItem;
     property Items[Idx: Integer]: TDbfFieldDef read GetItem;
     property DbfVersion: TXBaseVersion read FDbfVersion write FDbfVersion;
     property DbfVersion: TXBaseVersion read FDbfVersion write FDbfVersion;
-    property UseFloatFields: Boolean read FUseFloatFields write FUseFloatFields;
   end;
   end;
 
 
 implementation
 implementation
@@ -350,16 +348,13 @@ begin
           if FSize <= DIGITS_SMALLINT then
           if FSize <= DIGITS_SMALLINT then
             FFieldType := ftSmallInt
             FFieldType := ftSmallInt
           else
           else
-          if TDbfFieldDefs(Collection).UseFloatFields then
-            FFieldType := ftFloat
-          else
-{$ifdef SUPPORT_INT64}
           if FSize <= DIGITS_INTEGER then
           if FSize <= DIGITS_INTEGER then
             FFieldType := ftInteger
             FFieldType := ftInteger
           else
           else
+{$ifdef SUPPORT_INT64}
             FFieldType := ftLargeInt;
             FFieldType := ftLargeInt;
 {$else}
 {$else}
-            FFieldType := ftInteger;
+            FFieldType := ftFloat;
 {$endif}
 {$endif}
         end else begin
         end else begin
           FFieldType := ftFloat;
           FFieldType := ftFloat;

+ 9 - 1
fcl/db/dbase/history.txt

@@ -23,7 +23,7 @@ BUGS & WARNINGS
       don't know the index of the field they have to copy from (Dbf_Fields)
       don't know the index of the field they have to copy from (Dbf_Fields)
 - BCB3/D3 compatibility:
 - BCB3/D3 compatibility:
     - you will NOT be able to use Int64 features:
     - you will NOT be able to use Int64 features:
-      - large numeric fields with zero precision (set UseFloatFields to true)
+      - large numeric fields with zero precision (they will be float fields)
       - datetime fields '@'
       - datetime fields '@'
       - double fields 'O'
       - double fields 'O'
       - maybe more...look in source where Int64 is used
       - maybe more...look in source where Int64 is used
@@ -32,6 +32,14 @@ BUGS & WARNINGS
 
 
 
 
 
 
+------------------------
+V6.4.9
+
+- fix use long char fields check icw foxpro (thx rpoverdijk)
+- fix TDbf.GetRecNo AV when no file open
+- remove UseFloatFields, delphi 3 will use float fields, others not
+
+
 ------------------------
 ------------------------
 V6.4.8
 V6.4.8