|
From: Micha N. <md...@us...> - 2004-08-25 21:28:51
|
Update of /cvsroot/tdbf/tdbf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5145 Modified Files: dbf_fields.pas Log Message: fix setfieldtype / setdefaultsize Index: dbf_fields.pas =================================================================== RCS file: /cvsroot/tdbf/tdbf/dbf_fields.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dbf_fields.pas 23 Aug 2004 08:12:32 -0000 1.3 --- dbf_fields.pas 25 Aug 2004 21:28:42 -0000 1.4 *************** *** 297,301 **** FFieldType := lFieldType; VCLToNative; ! CheckSizePrecision; end; --- 297,301 ---- FFieldType := lFieldType; VCLToNative; ! SetDefaultSize; end; *************** *** 414,417 **** --- 414,418 ---- procedure TDbfFieldDef.SetDefaultSize; begin + // choose default values for variable size fields case FFieldType of ftFloat: *************** *** 430,434 **** FPrecision := 0; end; ! ftInteger: begin if DbfVersion = xBaseVII then --- 431,435 ---- FPrecision := 0; end; ! ftInteger, ftAutoInc: begin if DbfVersion = xBaseVII then *************** *** 445,457 **** end; {$endif} ! ftDate, ftDateTime: begin ! if (FNativeFieldType = 'T') and (DbfVersion <> xFoxPro) then ! FSize := 14 ! else ! FSize := 8; FPrecision := 0; end; end; // case fieldtype end; --- 446,458 ---- end; {$endif} ! ftString, ftFixedChar, ftWideString: begin ! FSize := 30; FPrecision := 0; end; end; // case fieldtype + + // set sizes for fields that are restricted to single size/precision + CheckSizePrecision; end; |