ExCtrls: Improved version of r8494.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8496 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-09-21 10:58:17 +00:00
parent eda54767e0
commit 352003d5d6

View File

@ -10,6 +10,9 @@ interface
uses
Classes, SysUtils, LCLVersion, Controls, SpinEx, Math;
// Fix of issues #39490 (FPC >v3.2.2/64bit) and #39793 (Laz >= 2.3.0)
{$define SAMEVALUE_FIX}
type
{ TCustomCurrEditEx }
TSpinEditCurrencyFormat = (
@ -57,7 +60,7 @@ type
procedure EditKeyPress(var Key: char); override;
function SafeInc(AValue: Currency): Currency; override;
function SafeDec(AValue: Currency): Currency; override;
{$IF FPC_FullVersion>=30202}
{$IFDEF SAMEVALUE_FIX}
function SameValue(AValue1, AValue2: Currency): Boolean; override;
{$ENDIF}
function TextIsNumber(const S: String; out ANumber: Currency): Boolean; override;
@ -351,7 +354,8 @@ begin
end;
// Workaround for https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39490
{$IF FPC_FullVersion>=30202}
// Required after https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39793
{$IFDEF SAMEVALUE_FIX}
function TCustomCurrSpinEditEx.SameValue(AValue1, AValue2: Currency): Boolean;
begin
Result := (AValue1 = AValue2);