[Libreoffice-commits] core.git: vcl/source

Michael Stahl mstahl at redhat.com
Mon May 18 15:07:49 PDT 2015


 vcl/source/gdi/mapmod.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 0a9b99787c65e49f08b27566d277eab8306cca54
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon May 18 23:47:43 2015 +0200

    vcl: fix the MapMode ctor too to limit precision to 32 bits
    
    Change-Id: Ifc27d4bd9225581197332c8e21c476eed5d13eb7

diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index eb61bb7..8607426 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -33,6 +33,10 @@ struct MapMode::ImplMapMode
     sal_uLong       mnRefCount;
     MapUnit         meUnit;
     Point           maOrigin;
+    // NOTE: these Fraction must NOT have more than 32 bits precision
+    // because ReadFraction / WriteFraction do only 32 bits, so more than
+    // that cannot be stored in MetaFiles!
+    // => call ReduceInaccurate whenever setting these
     Fraction        maScaleX;
     Fraction        maScaleY;
     bool            mbSimple;
@@ -158,6 +162,8 @@ MapMode::MapMode( MapUnit eUnit, const Point& rLogicOrg,
     mpImplMapMode->maOrigin = rLogicOrg;
     mpImplMapMode->maScaleX = rScaleX;
     mpImplMapMode->maScaleY = rScaleY;
+    mpImplMapMode->maScaleX.ReduceInaccurate(32);
+    mpImplMapMode->maScaleY.ReduceInaccurate(32);
 }
 
 MapMode::~MapMode()


More information about the Libreoffice-commits mailing list