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

David Tardon dtardon at redhat.com
Tue Oct 21 01:57:21 PDT 2014


 sc/source/core/data/drwlayer.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 166eaf213b3d43e54f2f5206d9680f75f720847f
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Oct 21 10:05:31 2014 +0200

    conversion to double should not be necessary
    
    Change-Id: I12ad83453b68077fe672576680b0cd5fd9acf49f

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 672c860..c51b58f 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -822,9 +822,13 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
                     Size aSizeMove(aNew.Left()-aOld.Left(), aNew.Top()-aOld.Top());
                     pObj->NbcMove(aSizeMove);
 
-                    double fXFrac = static_cast<double>(aNew.GetWidth()) / static_cast<double>(aOld.GetWidth());
-                    double fYFrac = static_cast<double>(aNew.GetHeight()) / static_cast<double>(aOld.GetHeight());
-                    pObj->NbcResize(aNew.TopLeft(), rational_FromDouble(fXFrac), rational_FromDouble(fYFrac));
+                    boost::rational<sal_Int64> aXFrac;
+                    boost::rational<sal_Int64> aYFrac;
+                    if (aOld.GetWidth() != 0)
+                        aXFrac.assign(aNew.GetWidth(), aOld.GetWidth());
+                    if (aOld.GetHeight() != 0)
+                        aYFrac.assign(aNew.GetHeight(), aOld.GetHeight());
+                    pObj->NbcResize(aNew.TopLeft(), aXFrac, aYFrac);
                 }
                 // order of these lines is important, modify rData.maLastRect carefully it is used as both
                 // a value and a flag for initialisation


More information about the Libreoffice-commits mailing list