summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-10-21 10:05:31 +0200
committerDavid Tardon <dtardon@redhat.com>2014-10-21 10:54:43 +0200
commit166eaf213b3d43e54f2f5206d9680f75f720847f (patch)
treee1d9b06039d40270c44812417a94f7206d1003bf
parenta29301cf696ac093c03de05248c3c6adffd14818 (diff)
conversion to double should not be necessary
Change-Id: I12ad83453b68077fe672576680b0cd5fd9acf49f
-rw-r--r--sc/source/core/data/drwlayer.cxx10
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