diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 10:16:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-13 15:47:04 +0200 |
commit | 158434ee87cfff8870f7c411f435ad46782ab818 (patch) | |
tree | 8e3b6fb6d6986318454760b3f8224763d8cad648 /svx/source/svdraw/svdxcgv.cxx | |
parent | 1b1afc10f4d90e37c5e81961b8b8902133e65b00 (diff) |
no need to call GetNumerator() / GetDenominator() for Fraction
simplify the calculations - why have a Fraction and then just split
it up for the calculation?
Change-Id: I81af95e1ee1633f77e088c0990f308b1c169a6a2
Reviewed-on: https://gerrit.libreoffice.org/42242
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdxcgv.cxx')
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 0debc4ab8e31..38db94a5aa37 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -402,18 +402,10 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po MapUnit eDstMU=mpModel->GetScaleUnit(); FrPair aMapFact(GetMapFactor(eSrcMU,eDstMU)); Fraction aDstFr(mpModel->GetScaleFraction()); - nSizX*=aMapFact.X().GetNumerator(); - nSizX*=rMap.GetScaleX().GetNumerator(); - nSizX*=aDstFr.GetDenominator(); - nSizX/=aMapFact.X().GetDenominator(); - nSizX/=rMap.GetScaleX().GetDenominator(); - nSizX/=aDstFr.GetNumerator(); - nSizY*=aMapFact.Y().GetNumerator(); - nSizY*=rMap.GetScaleY().GetNumerator(); - nSizX*=aDstFr.GetDenominator(); - nSizY/=aMapFact.Y().GetDenominator(); - nSizY/=rMap.GetScaleY().GetDenominator(); - nSizY/=aDstFr.GetNumerator(); + nSizX *= double(aMapFact.X() * rMap.GetScaleX() * aDstFr); + nSizX *= aDstFr.GetDenominator(); + nSizY *= double(aMapFact.Y() * rMap.GetScaleY()); + nSizY /= aDstFr.GetNumerator(); long xs=nSizX; long ys=nSizY; Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2); |