summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/mapmod.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-05-18 23:47:43 +0200
committerMichael Stahl <mstahl@redhat.com>2015-05-18 23:47:43 +0200
commit0a9b99787c65e49f08b27566d277eab8306cca54 (patch)
treed60c4f14f29e0ddf2197a67a6d7b6e6155f938bf /vcl/source/gdi/mapmod.cxx
parent21be3257d9d10f0f65c2ae49d7ef3beb81018bfc (diff)
vcl: fix the MapMode ctor too to limit precision to 32 bits
Change-Id: Ifc27d4bd9225581197332c8e21c476eed5d13eb7
Diffstat (limited to 'vcl/source/gdi/mapmod.cxx')
-rw-r--r--vcl/source/gdi/mapmod.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index eb61bb753c4b..860742648ea7 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()