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

Caolán McNamara caolanm at redhat.com
Fri Oct 23 08:45:26 PDT 2015


 vcl/source/filter/wmf/winmtf.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 4eb70290210022860294644d67ba50d55806621c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 23 16:40:25 2015 +0100

    take the world scaling factor for fonts, but not the rotation
    
    regression from
    
    commit 8f705df1221c3f92d8cde68bdf726a7c3ce8fe1b
    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
    
    which seems to be a regression from
    
    commit 1281c1f52b77c4c4fb08e129542c2c4912b38555
    Author: Armin Le Grand <alg at apache.org>
    Date:   Mon Dec 10 16:08:58 2012 +0000
    
        Resolves: #i121382# Corrected size handling including font size handling...
    
        for EMF/WMF imports
    
    Change-Id: I87307c9993d3343b4db636257e2567b10a73b79d

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index a768b32..c9f8750 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -408,8 +408,18 @@ Size WinMtfOutput::ImplMap(const Size& rSz, bool bDoWorldTransform)
         }
         else
         {
-            fWidth = rSz.Width();
-            fHeight = rSz.Height();
+            //take the scale, but not the rotation
+            basegfx::B2DHomMatrix aMatrix(maXForm.eM11, maXForm.eM12, 0,
+                                          maXForm.eM21, maXForm.eM22, 0);
+            basegfx::B2DTuple aScale, aTranslate;
+            double fRotate, fShearX;
+            if (!aMatrix.decompose(aScale, aTranslate, fRotate, fShearX))
+            {
+                aScale.setX(1.0);
+                aScale.setY(1.0);
+            }
+            fWidth = rSz.Width() * aScale.getX();
+            fHeight = rSz.Height() * aScale.getY();
         }
 
         if ( mnGfxMode == GM_COMPATIBLE )


More information about the Libreoffice-commits mailing list