[Libreoffice-commits] libmspub.git: 2 commits - src/lib

David Tardon dtardon at redhat.com
Thu Feb 15 09:43:33 UTC 2018


 src/lib/MSPUBParser.cpp |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 2be062bd914c000899a03822664f9a523d435f3e
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Feb 15 10:42:06 2018 +0100

    drop unnecessary variables
    
    Change-Id: If3d15512433406399716e458c666b81dc7aa41ef

diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index da4de8b..1f6fa95 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -1973,12 +1973,10 @@ void MSPUBParser::parseEscherShape(librevenge::RVNGInputStream *input, const Esc
           }
           if (rotated90)
           {
-            int initialX = absolute.m_xs;
-            int initialY = absolute.m_ys;
             int initialWidth = int64_t(absolute.m_xe) - absolute.m_xs;
             int initialHeight = int64_t(absolute.m_ye) - absolute.m_ys;
-            int centerX = int64_t(initialX) + initialWidth / 2;
-            int centerY = int64_t(initialY) + initialHeight / 2;
+            int centerX = int64_t(absolute.m_xs) + initialWidth / 2;
+            int centerY = int64_t(absolute.m_ys) + initialHeight / 2;
             int xs = centerX - initialHeight / 2;
             int ys = centerY - initialWidth / 2;
             int xe = xs + initialHeight;
commit a500976df2557c4c4c5f90bda0a401319573ceff
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Feb 15 10:41:20 2018 +0100

    ofz#6339 avoid signed int overflow
    
    Change-Id: I6459deafb6d0dabc47e6e446457165b6814f348e

diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp
index 1078eda..da4de8b 100644
--- a/src/lib/MSPUBParser.cpp
+++ b/src/lib/MSPUBParser.cpp
@@ -1977,8 +1977,8 @@ void MSPUBParser::parseEscherShape(librevenge::RVNGInputStream *input, const Esc
             int initialY = absolute.m_ys;
             int initialWidth = int64_t(absolute.m_xe) - absolute.m_xs;
             int initialHeight = int64_t(absolute.m_ye) - absolute.m_ys;
-            int centerX = initialX + initialWidth / 2;
-            int centerY = initialY + initialHeight / 2;
+            int centerX = int64_t(initialX) + initialWidth / 2;
+            int centerY = int64_t(initialY) + initialHeight / 2;
             int xs = centerX - initialHeight / 2;
             int ys = centerY - initialWidth / 2;
             int xe = xs + initialHeight;


More information about the Libreoffice-commits mailing list