mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 16:55:58 +02:00
xml component stream reader: raise exception on invalid floats
git-svn-id: trunk@22358 -
This commit is contained in:
parent
26937520e4
commit
030a84366d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user