mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 13:59:50 +02:00
LCL: removed old workaround from TFloatSpinEdit. It worked around a bug which was fixed in FPC 2.4.0. Bug #18674.
git-svn-id: trunk@29397 -
This commit is contained in:
parent
de68945dc9
commit
5492a17fbb
@ -184,23 +184,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomFloatSpinEdit.StrToValue(const S: String): Double;
|
function TCustomFloatSpinEdit.StrToValue(const S: String): Double;
|
||||||
|
|
||||||
// this is a workaround for the fpc rtl bug in StrToFloatDef function
|
|
||||||
// which happens when DecimalSeparator = ThousandSeparator
|
|
||||||
// (look at issue 0013293)
|
|
||||||
function MyStrToFloatDef(S: String; Def: Double): Double;
|
|
||||||
var
|
|
||||||
V: Extended;
|
|
||||||
begin
|
|
||||||
if TextToFloat(PChar(S), V) then
|
|
||||||
Result := V
|
|
||||||
else
|
|
||||||
Result := Def;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
Result := GetLimitedValue(MyStrToFloatDef(S, FValue));
|
Result := GetLimitedValue(StrToFloatDef(S, FValue));
|
||||||
except
|
except
|
||||||
Result := FValue;
|
Result := FValue;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user