kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0047-bnc-881024-Don-t-world-transform-font-size-in-WMF-EM.patch

f085be
From f5949d09321e3ac62538df0e70e58284bd1cab32 Mon Sep 17 00:00:00 2001
f085be
From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= <tomaz.vajngerl@collabora.com>
f085be
Date: Fri, 18 Jul 2014 13:36:13 +0200
f085be
Subject: [PATCH 047/137] bnc#881024 Don't world transform font size in WMF/EMF
f085be
 import
f085be
f085be
Conflicts:
f085be
	vcl/source/filter/wmf/winmtf.cxx
f085be
f085be
Change-Id: Ia865b84ee2b159ff7251ab5a769a2b635dd2a1ea
f085be
Reviewed-on: https://gerrit.libreoffice.org/10434
f085be
Reviewed-by: Andras Timar <andras.timar@collabora.com>
f085be
Tested-by: Andras Timar <andras.timar@collabora.com>
f085be
---
f085be
 vcl/source/filter/wmf/winmtf.cxx | 18 +++++++++++++-----
f085be
 vcl/source/filter/wmf/winmtf.hxx |  2 +-
f085be
 2 files changed, 14 insertions(+), 6 deletions(-)
f085be
f085be
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
f085be
index 38e79a8..d8c2a67 100644
f085be
--- a/vcl/source/filter/wmf/winmtf.cxx
f085be
+++ b/vcl/source/filter/wmf/winmtf.cxx
f085be
@@ -412,14 +412,22 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
f085be
         return Point();
f085be
 };
f085be
 
f085be
-
f085be
-Size WinMtfOutput::ImplMap( const Size& rSz )
f085be
+Size WinMtfOutput::ImplMap(const Size& rSz, bool bDoWorldTransform)
f085be
 {
f085be
     if ( mnWinExtX && mnWinExtY )
f085be
     {
f085be
         // #i121382# apply the whole WorldTransform, else a rotation will be misinterpreted
f085be
-        double fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21;
f085be
-        double fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22;
f085be
+        double fWidth, fHeight;
f085be
+        if (bDoWorldTransform)
f085be
+        {
f085be
+            fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() * maXForm.eM21;
f085be
+            fHeight = rSz.Width() * maXForm.eM12 + rSz.Height() * maXForm.eM22;
f085be
+        }
f085be
+        else
f085be
+        {
f085be
+            fWidth = rSz.Width();
f085be
+            fHeight = rSz.Height();
f085be
+        }
f085be
 
f085be
         if ( mnGfxMode == GM_COMPATIBLE )
f085be
         {
f085be
@@ -483,7 +491,7 @@ void WinMtfOutput::ImplMap( Font& rFont )
f085be
 {
f085be
     // !!! HACK: we now always set the width to zero because the OS width is interpreted differently;
f085be
     // must later be made portable in SV (KA 1996-02-08)
f085be
-    Size  aFontSize = ImplMap ( rFont.GetSize() );
f085be
+    Size  aFontSize = ImplMap (rFont.GetSize(), false);
f085be
 
f085be
     if( aFontSize.Height() < 0 )
f085be
         aFontSize.Height() *= -1;
f085be
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
f085be
index 9db9245..e2c1f1c 100644
f085be
--- a/vcl/source/filter/wmf/winmtf.hxx
f085be
+++ b/vcl/source/filter/wmf/winmtf.hxx
f085be
@@ -632,7 +632,7 @@ class WinMtfOutput
f085be
 
f085be
     Point               ImplMap( const Point& rPt );
f085be
     Point               ImplScale( const Point& rPt );
f085be
-    Size                ImplMap( const Size& rSz );
f085be
+    Size                ImplMap( const Size& rSize, bool bDoWorldTransform = true);
f085be
     Rectangle           ImplMap( const Rectangle& rRectangle );
f085be
     void                ImplMap( Font& rFont );
f085be
     Polygon&            ImplMap( Polygon& rPolygon );
f085be
-- 
f085be
1.9.3
f085be