From: <ob...@us...> - 2007-01-04 10:28:35
|
Revision: 11122 http://svn.sourceforge.net/jvcl/?rev=11122&view=rev Author: obones Date: 2007-01-04 02:28:34 -0800 (Thu, 04 Jan 2007) Log Message: ----------- Mantis 3924: BCD fields are now taken into account correctly Modified Paths: -------------- trunk/jvcl/run/JvDBControls.pas Modified: trunk/jvcl/run/JvDBControls.pas =================================================================== --- trunk/jvcl/run/JvDBControls.pas 2007-01-04 10:28:10 UTC (rev 11121) +++ trunk/jvcl/run/JvDBControls.pas 2007-01-04 10:28:34 UTC (rev 11122) @@ -726,6 +726,9 @@ implementation uses + {$IFDEF COMPILER6_UP} + FMTBcd, + {$ENDIF COMPILER6_UP} {$IFDEF HAS_UNIT_VARIANTS} Variants, {$ENDIF HAS_UNIT_VARIANTS} @@ -2184,13 +2187,30 @@ //if (Value = 0) and ZeroEmpty then // FDataLink.Field.Clear else - if FDataLink.Field.DataType in [ftSmallint, ftInteger, ftWord] then - FDataLink.Field.AsInteger := Self.AsInteger - else - if FDataLink.Field.DataType = ftBoolean then - FDataLink.Field.AsBoolean := Boolean(Self.AsInteger) - else - FDataLink.Field.AsFloat := Self.Value; + + case FDataLink.Field.DataType of + ftSmallint, + ftInteger, + ftWord: + begin + FDataLink.Field.AsInteger := Self.AsInteger; + end; + ftBoolean: + begin + FDataLink.Field.AsBoolean := Boolean(Self.AsInteger); + end; + {$IFDEF COMPILER6_UP} + ftFMTBcd, + {$ENDIF COMPILER6_UP} + ftBCD: + begin + FDataLink.Field.AsBCD := DoubleToBCD(Self.Value) + end; + else + begin + FDataLink.Field.AsFloat := Self.Value; + end; + end; end; procedure TJvDBCalcEdit.CMGetDataLink(var Msg: TMessage); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |