TFloatSpinEdit(Ex): fix crash in OI when setting MaxValue/MinValue/Increment. Issue #39792.

This commit is contained in:
Bart 2022-09-17 19:03:08 +02:00
parent 4a30435502
commit 95cfa51d1b
2 changed files with 4 additions and 4 deletions

View File

@ -213,12 +213,12 @@ end;
function TSpinEditExBase.MaxValueStored: Boolean;
begin
Result := not SameValue(FMaxValue, DefMaxValue);
Result := not SameValue(FMaxValue, T(DefMaxValue)); //use typecast to force use of correct overload. Issue #39792
end;
function TSpinEditExBase.MinValueStored: Boolean;
begin
Result := not SameValue(FMinValue, DefMinValue);
Result := not SameValue(FMinValue, T(DefMinValue)); //use typecast to force use of correct overload. Issue #39792
end;
procedure TSpinEditExBase.EditMouseWheelUp(Shift: TShiftState;

View File

@ -119,7 +119,7 @@ end;
function TCustomFloatSpinEdit.MaxValueStored: Boolean;
begin
Result := not SameValue(FMaxValue, DefMaxValue);
Result := not SameValue(FMaxValue, Double(DefMaxValue)); //use typecast to force use of correct overload. Issue #39792
end;
procedure TCustomFloatSpinEdit.KeyPress(var Key: char);
@ -193,7 +193,7 @@ end;
function TCustomFloatSpinEdit.IncrementStored: Boolean;
begin
Result := not SameValue(FIncrement, DefIncrement);
Result := not SameValue(FIncrement, Double(DefIncrement)); //use typecast to force use of correct overload. Issue #39792
end;
procedure TCustomFloatSpinEdit.SetDecimals(ADecimals: Integer);