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

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Mon Jul 21 11:30:27 PDT 2014


 vcl/source/filter/wmf/winmtf.cxx |   18 +++++++++++++-----
 vcl/source/filter/wmf/winmtf.hxx |    2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit f5949d09321e3ac62538df0e70e58284bd1cab32
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Fri Jul 18 13:36:13 2014 +0200

    bnc#881024 Don't world transform font size in WMF/EMF import
    
    Conflicts:
    	vcl/source/filter/wmf/winmtf.cxx
    
    Change-Id: Ia865b84ee2b159ff7251ab5a769a2b635dd2a1ea
    Reviewed-on: https://gerrit.libreoffice.org/10434
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 38e79a8..d8c2a67 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -412,14 +412,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 )
         {
@@ -483,7 +491,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 9db9245..e2c1f1c 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -632,7 +632,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 );


More information about the Libreoffice-commits mailing list