xml component stream reader: raise exception on invalid floats

git-svn-id: trunk@22358 -
This commit is contained in:
mattias 2009-10-31 11:39:06 +00:00
parent 26937520e4
commit 030a84366d

View File

@ -954,14 +954,10 @@ end;
function TXMLObjectReader.ReadFloat: Extended;
var
Value: String;
FloatError: integer;
Back: extended;
begin
Result:=0;
Value:=FElement['value'];
Val(Value, Back, FloatError);
if FloatError=0 then ;
Result:=Back;
Result:=StrToFloat(Value);
ReadValue;
//writeln('TXMLObjectReader.ReadFloat ',Result);
end;
@ -984,14 +980,10 @@ end;
function TXMLObjectReader.ReadCurrency: Currency;
var
Value: String;
FloatError: integer;
Back: currency;
begin
Result:=0;
Value:=FElement['value'];
Val(Value, Back, FloatError);
if FloatError=0 then ;
Result:=Back;
Result:=StrToFloat(Value);
ReadValue;
//writeln('TXMLObjectReader.ReadCurrency ',Result);
end;
@ -999,14 +991,10 @@ end;
function TXMLObjectReader.ReadDate: TDateTime;
var
Value: String;
FloatError: integer;
Back: Double;
begin
Result:=0;
Value:=FElement['value'];
Val(Value, Back, FloatError);
if FloatError=0 then ;
Result:=Back;
Result:=StrToFloat(Value);
ReadValue;
//writeln('TXMLObjectReader.ReadDate ',Result);
end;