summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-07-18 13:36:13 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-07-21 10:24:29 +0200
commit93a77d07fa49cad9d836699a48777e0e8ff170b4 (patch)
tree39876a562dfddc4a59c1e865135fdcff2224d725
parent4641e8f3e2675386df4418506861945e35cd69a0 (diff)
bnc#881024 Don't world transform font size in WMF/EMF import
Change-Id: Ia865b84ee2b159ff7251ab5a769a2b635dd2a1ea
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx17
-rw-r--r--vcl/source/filter/wmf/winmtf.hxx2
2 files changed, 14 insertions, 5 deletions
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index a25bcc78aff5..b8994cb3caa4 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -389,13 +389,22 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
return Point();
};
-Size WinMtfOutput::ImplMap( const Size& rSz )
+Size WinMtfOutput::ImplMap(const Size& rSz, bool bDoWorldTransform)
{
if ( mnWinExtX && mnWinExtY )
{
// #i121382# apply the whole WorldTransform, else a rotation will be misinterpreted
- double fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21;
- double fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22;
+ double fWidth, fHeight;
+ if (bDoWorldTransform)
+ {
+ fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21;
+ fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22;
+ }
+ else
+ {
+ fWidth = rSz.Width();
+ fHeight = rSz.Height();
+ }
if ( mnGfxMode == GM_COMPATIBLE )
{
@@ -457,7 +466,7 @@ void WinMtfOutput::ImplMap( Font& rFont )
{
// !!! HACK: we now always set the width to zero because the OS width is interpreted differently;
// must later be made portable in SV (KA 1996-02-08)
- Size aFontSize = ImplMap (rFont.GetSize());
+ Size aFontSize = ImplMap (rFont.GetSize(), false);
if( aFontSize.Height() < 0 )
aFontSize.Height() *= -1;
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index d925bc7c6c6a..4ca045988cce 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -635,7 +635,7 @@ class WinMtfOutput
Point ImplMap( const Point& rPt );
Point ImplScale( const Point& rPt );
- Size ImplMap( const Size& rSz );
+ Size ImplMap( const Size& rSize, bool bDoWorldTransform = true);
Rectangle ImplMap( const Rectangle& rRectangle );
void ImplMap( Font& rFont );
Polygon& ImplMap( Polygon& rPolygon );