From 64bd083a42768fc7742b2e338d07a0211438b165 Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 12 Apr 2018 21:09:50 +0000 Subject: [PATCH] LCL: spin: cleanup git-svn-id: trunk@57650 - --- lcl/include/spinedit.inc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lcl/include/spinedit.inc b/lcl/include/spinedit.inc index bbc5308b5a..016fc2f68b 100644 --- a/lcl/include/spinedit.inc +++ b/lcl/include/spinedit.inc @@ -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;