diff options
author | David Tardon <dtardon@redhat.com> | 2014-10-21 10:05:31 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-10-21 10:54:43 +0200 |
commit | 166eaf213b3d43e54f2f5206d9680f75f720847f (patch) | |
tree | e1d9b06039d40270c44812417a94f7206d1003bf | |
parent | a29301cf696ac093c03de05248c3c6adffd14818 (diff) |
conversion to double should not be necessary
Change-Id: I12ad83453b68077fe672576680b0cd5fd9acf49f
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 672c86078434..c51b58fef8b2 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 |