|
From: Micha N. <md...@us...> - 2004-08-20 19:20:26
|
Update of /cvsroot/tdbf/tdbf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6328 Modified Files: dbf_common.inc dbf_common.pas dbf_dbffile.pas dbf_fields.pas history.txt Log Message: - fixed: datetime issues with fieldtype '@' and delphi 4 and lower (nobody uses those fieldtypes? they have been horribly broken, and maybe still are) Index: dbf_fields.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_fields.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbf_fields.pas 18 Aug 2004 20:00:40 -0000 1.1 --- dbf_fields.pas 20 Aug 2004 19:20:15 -0000 1.2 *************** *** 382,390 **** ftAutoInc : FNativeFieldType := '+'; ftDateTime : - {$ifdef SUPPORT_INT64} if DbfVersion = xBaseVII then FNativeFieldType := '@' else - {$endif} FNativeFieldType := 'T'; {$ifdef SUPPORT_FIELDTYPES_V4} --- 382,388 ---- *************** *** 451,455 **** ftDate, ftDateTime: begin ! if FNativeFieldType = 'T' then FSize := 14 else --- 449,453 ---- ftDate, ftDateTime: begin ! if (FNativeFieldType = 'T') and (DbfVersion <> xFoxPro) then FSize := 14 else *************** *** 522,526 **** 'T': begin ! FSize := 14; FPrecision := 0; end; --- 520,527 ---- 'T': begin ! if DbfVersion = xFoxPro then ! FSize := 8 ! else ! FSize := 14; FPrecision := 0; end; Index: history.txt =================================================================== RCS file: /cvsroot/tdbf/tdbf/history.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** history.txt 19 Aug 2004 10:13:42 -0000 1.64 --- history.txt 20 Aug 2004 19:20:15 -0000 1.65 *************** *** 52,55 **** --- 52,57 ---- - added: partial matching in expressions for filters - added: -, *, / operators in expressions + - fixed: datetime issues with fieldtype '@' and delphi 4 and lower (nobody uses + those fieldtypes? they have been horribly broken, and maybe still are) Index: dbf_dbffile.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_dbffile.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbf_dbffile.pas 18 Aug 2004 20:00:40 -0000 1.1 --- dbf_dbffile.pas 20 Aug 2004 19:20:15 -0000 1.2 *************** *** 1342,1346 **** if DataType = ftDateTime then begin ! PDateTimeRec(Dst).DateTime := DateTimeToBDETimeStamp(date); end else begin PLongInt(Dst)^ := DateTimeToTimeStamp(date).Date; --- 1342,1346 ---- if DataType = ftDateTime then begin ! PDateTimeRec(Dst)^.DateTime := date; end else begin PLongInt(Dst)^ := DateTimeToTimeStamp(date).Date; *************** *** 1391,1399 **** '@': begin ! {$ifdef SUPPORT_INT64} ! Result := (PInt64(Src)^ <> 0); if Result then SwapInt64(Src, Dst); ! {$endif} end; 'T': --- 1391,1404 ---- '@': begin ! Result := (PInteger(Src)^ <> 0) and (PInteger(PChar(Src)+4)^ <> 0); if Result then + begin SwapInt64(Src, Dst); ! if FDateTimeHandling = dtBDETimeStamp then ! date := BDETimeStampToDateTime(PDouble(Dst)^) ! else ! date := PDateTime(Dst)^; ! SaveDateToDst; ! end; end; 'T': *************** *** 1536,1540 **** if DataType = ftDateTime then begin ! date := BDETimeStampToDateTime(PDouble(Src)^); end else begin timeStamp.Time := 0; --- 1541,1545 ---- if DataType = ftDateTime then begin ! date := PDouble(Src)^; end else begin timeStamp.Time := 0; *************** *** 1579,1588 **** '@': begin - {$ifdef SUPPORT_INT64} if Src = nil then ! PInteger(Dst)^ := 0 ! else ! SwapInt64(Src, Dst); ! {$endif} end; 'T': --- 1584,1597 ---- '@': begin if Src = nil then ! begin ! PInteger(Dst)^ := 0; ! PInteger(PChar(Dst)+4)^ := 0; ! end else begin ! LoadDateFromSrc; ! if FDateTimeHandling = dtBDETimeStamp then ! date := DateTimeToBDETimeStamp(date); ! SwapInt64(@date, Dst); ! end; end; 'T': Index: dbf_common.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_common.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbf_common.pas 18 Aug 2004 20:00:40 -0000 1.1 --- dbf_common.pas 20 Aug 2004 19:20:15 -0000 1.2 *************** *** 87,94 **** function GetCompleteFileName(const Base, FileName: string): string; function IsFullFilePath(const Path: string): Boolean; // full means not relative - {$ifndef SUPPORT_NEW_FIELDDATA} function DateTimeToBDETimeStamp(aDT: TDateTime): double; function BDETimeStampToDateTime(aBT: double): TDateTime; - {$endif} function GetStrFromInt(Val: Integer; const Dst: PChar): Integer; procedure GetStrFromInt_Width(Val: Integer; const Width: Integer; const Dst: PChar; const PadChar: Char); --- 87,92 ---- *************** *** 317,322 **** {$endif} - {$ifndef SUPPORT_NEW_FIELDDATA} - function DateTimeToBDETimeStamp(aDT: TDateTime): double; var --- 315,318 ---- *************** *** 335,340 **** end; - {$endif} - //==================================================================== --- 331,334 ---- Index: dbf_common.inc =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_common.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dbf_common.inc 18 Aug 2004 20:00:40 -0000 1.1 --- dbf_common.inc 20 Aug 2004 19:20:15 -0000 1.2 *************** *** 161,165 **** {$ifndef FPC_LITTLE_ENDIAN} ! #ERROR TDbf is not compatible with non little-endian processors. Please contact the author. {$endif} --- 161,165 ---- {$ifndef FPC_LITTLE_ENDIAN} ! {$message error TDbf is not compatible with non little-endian CPUs. Please contact the author.} {$endif} *************** *** 183,187 **** {$undef SUPPORT_NEW_TRANSLATE} ! #ERROR TDbf needs fpc 1.9 minimum. {$endif} --- 183,187 ---- {$undef SUPPORT_NEW_TRANSLATE} ! {$message error TDbf needs fpc 1.9 minimum.} {$endif} |