[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Wed Oct 29 05:02:24 PDT 2014


 sw/source/core/layout/frmtool.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6906f659a2ef5f57fd71ddd79055b5563aa7ac22
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Oct 29 13:01:44 2014 +0100

    Fix -fsanitize=signed-integer-overflow (when long int is 32-bit)
    
    Change-Id: I25a96479eafa97eccace2879bf8e1af5e85f60c8

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index e0b3c28..9c766ea 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3301,7 +3301,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
                     // Point not in rectangle. Compare distances:
                     const Point aCalcRectCenter = aCalcRect.Center();
                     const Point aDiff = aCalcRectCenter - *pPoint;
-                    const sal_uInt64 nCurrentDist = aDiff.getX() * aDiff.getX() + aDiff.getY() * aDiff.getY(); // opt: no sqrt
+                    const sal_uInt64 nCurrentDist = sal_Int64(aDiff.getX()) * sal_Int64(aDiff.getX()) + sal_Int64(aDiff.getY()) * sal_Int64(aDiff.getY()); // opt: no sqrt
                     if ( !pMinFrm || nCurrentDist < nMinDist )
                     {
                         pMinFrm = pTmpFrm;


More information about the Libreoffice-commits mailing list