From 91e4b550093142737b575fbfd3c0cba03c8d922e Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 3 Nov 2019 11:05:08 +0000 Subject: [PATCH] fpspreadsheet: Fix 32-bit overflow in fpsutils.Round(). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7174 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/fpsutils.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/fpspreadsheet/source/common/fpsutils.pas b/components/fpspreadsheet/source/common/fpsutils.pas index 386b71ca6..cd81ac0c6 100644 --- a/components/fpspreadsheet/source/common/fpsutils.pas +++ b/components/fpspreadsheet/source/common/fpsutils.pas @@ -153,7 +153,7 @@ function TryStrToFloatAuto(AText: String; out ANumber: Double; function TryFractionStrToFloat(AText: String; out ANumber: Double; out AIsMixed: Boolean; out AMaxDigits: Integer): Boolean; -function Round(AValue: Double): Integer; +function Round(AValue: Double): Int64; function cmToPts(AValue: Double): Double; inline; function EMUToIn(AValue: Int64): Double; inline; @@ -1854,7 +1854,7 @@ end; {@@ ---------------------------------------------------------------------------- Special rounding function which avoids banker's rounding -------------------------------------------------------------------------------} -function Round(AValue: Double): Integer; +function Round(AValue: Double): Int64; begin if AValue > 0 then Result := trunc(AValue + 0.5)