LCL: spin: cleanup

git-svn-id: trunk@57650 -
This commit is contained in:
ondrej 2018-04-12 21:09:50 +00:00
parent c7ce7e191e
commit 64bd083a42

View File

@ -129,13 +129,12 @@ end;
procedure TCustomFloatSpinEdit.SetValue(const AValue: Double);
var
ValueFromText: Extended;
OldValue: Double;
ValueFromText, OldValue: Double;
begin
if (FValue = AValue)
if SameValue(FValue, AValue)
//if you set text by code (or paste it) and text is not a valid float, then FValue will hold the previous value
//and in that case we should not exit here...
and (TryStrToFloat(Text, ValueFromText) and (ValueFromText = FValue)) then Exit;
and (TryStrToFloat(Text, ValueFromText) and SameValue(ValueFromText, FValue)) then Exit;
OldValue := FValue;
FValue := AValue;