From 182cc8b8e6d6a671eb62f7177ff86ee948814de8 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Sat, 27 Nov 2021 00:30:47 +0100 Subject: [PATCH] LazControls/SpinEditExBase: Add virtual method SameValue() to fix compilation issue on Win/x64 for a currency descendant. Issue #39490. --- components/lazcontrols/spinex.inc | 7 +++++++ components/lazcontrols/spinex.pp | 1 + 2 files changed, 8 insertions(+) diff --git a/components/lazcontrols/spinex.inc b/components/lazcontrols/spinex.inc index 1987a46800..44722a483c 100644 --- a/components/lazcontrols/spinex.inc +++ b/components/lazcontrols/spinex.inc @@ -237,6 +237,13 @@ begin SpinUpDown(False); end; +{ This is added as a virtual method because the 64-bit compiler on Windows cannot + determine which overloaded function to call when T is Currency. } +function TSpinEditExBase.SameValue(AValue1, AValue2: T): Boolean; +begin + Result := Math.SameValue(AValue1, AValue2); +end; + procedure TSpinEditExBase.SetValue(const AValue: T); var ValueFromText: T; diff --git a/components/lazcontrols/spinex.pp b/components/lazcontrols/spinex.pp index 7cddfcbdc9..9ced99197f 100644 --- a/components/lazcontrols/spinex.pp +++ b/components/lazcontrols/spinex.pp @@ -141,6 +141,7 @@ type procedure EditMouseWheelDown(Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); override; function SafeInc(AValue: T): T; virtual; abstract; function SafeDec(AValue: T): T; virtual abstract; + function SameValue(AValue1, AValue2: T): boolean; virtual; procedure SetValue(const AValue: T); virtual; procedure SetNullValue(AValue: T); virtual; procedure SetMaxValue(const AValue: T); virtual;