[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sd/source

Caolán McNamara caolanm at redhat.com
Thu Jan 8 08:27:09 PST 2015


 sd/source/ui/tools/PreviewRenderer.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d4cac1465ab5b12c77c4566b62bc0d367ec27400
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
    (cherry picked from commit 00205f178f4c1edfc2201fa298e7335ca3dd7b44)
    Reviewed-on: https://gerrit.libreoffice.org/13812
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

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