[Libreoffice-commits] core.git: sd/source
Caolán McNamara
caolanm at redhat.com
Thu Jan 8 07:55:24 PST 2015
sd/source/ui/tools/PreviewRenderer.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 00205f178f4c1edfc2201fa298e7335ca3dd7b44
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jan 8 15:18:08 2015 +0000
Fraction fiasco: avoid assert on clicking "master pages" in impress sidebar
avoids the dread assert in vcl wrt. "detect overflows" in ImplLogicToPixel of
vcl/source/outdev/map.cxx but the whole thing looks a nightmare if a high
precision double is given as an arg to Fraction and the underlying boost foo
uses longs longer than 32bits to represent that.
Change-Id: Ia0fa911cf07ed613e0b1bbd97b63a291f29628cb
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index 4de09a1..b5f2b71 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -171,9 +171,9 @@ Image PreviewRenderer::RenderSubstitution (
// visible.
MapMode aMapMode (mpPreviewDevice->GetMapMode());
aMapMode.SetMapUnit(MAP_100TH_MM);
- const double nFinalScale (25.0 * rPreviewPixelSize.Width() / 28000.0);
- aMapMode.SetScaleX(nFinalScale);
- aMapMode.SetScaleY(nFinalScale);
+ Fraction aFinalScale(25 * rPreviewPixelSize.Width(), 28000);
+ aMapMode.SetScaleX(aFinalScale);
+ aMapMode.SetScaleY(aFinalScale);
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
aMapMode.SetOrigin(mpPreviewDevice->PixelToLogic(
Point(nFrameWidth,nFrameWidth),aMapMode));
More information about the Libreoffice-commits
mailing list