Blame SOURCES/0003-fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch

f0633d
From 22f63e3e7be99f13fd719ffc03aa78e34bd545af Mon Sep 17 00:00:00 2001
f0633d
From: Jan Holesovsky <kendy@collabora.com>
f0633d
Date: Wed, 27 Nov 2013 12:12:42 +0100
f0633d
Subject: [PATCH 003/109] fdo#61272: Do the mapping correctly both for WMF and
f0633d
 EMF.
f0633d
f0633d
Turns out that for the WMF, we already had everything set up correctly, we
f0633d
were just overwriting the right settings with default data again :-) - fix
f0633d
that.
f0633d
f0633d
Includes the following commits:
f0633d
f0633d
* Revert "wmf-mm-text-1.diff: Fix WMF rendering, n#417818"
f0633d
* Revert "wmf-mm-text.diff: Fix WMF rendering, n#417818"
f0633d
* fdo#56886 EMF: Fixes some scaling problems of clipped regions, Twips
f0633d
f0633d
Change-Id: I7ff859246dbaea3868438d3632f9adc60fc4ee37
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6829
f0633d
Reviewed-by: Andras Timar <andras.timar@collabora.com>
f0633d
Tested-by: Andras Timar <andras.timar@collabora.com>
f0633d
---
f0633d
 vcl/source/filter/wmf/winmtf.cxx | 33 +--------------------------------
f0633d
 vcl/source/filter/wmf/winmtf.hxx |  1 -
f0633d
 vcl/source/filter/wmf/winwmf.cxx |  1 -
f0633d
 3 files changed, 1 insertion(+), 34 deletions(-)
f0633d
f0633d
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
f0633d
index c8c6652..6d44084 100644
f0633d
--- a/vcl/source/filter/wmf/winmtf.cxx
f0633d
+++ b/vcl/source/filter/wmf/winmtf.cxx
f0633d
@@ -374,19 +374,6 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
f0633d
         {
f0633d
             switch( mnMapMode )
f0633d
             {
f0633d
-                case MM_TEXT:
f0633d
-                    fX2 -= mnWinOrgX;
f0633d
-                    fY2 -= mnWinOrgY;
f0633d
-                    if( mnDevWidth != 1 || mnDevHeight != 1 ) {
f0633d
-                        fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
f0633d
-                        fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
f0633d
-                    }
f0633d
-                    fX2 += mnDevOrgX;
f0633d
-                    fY2 += mnDevOrgY;
f0633d
-                    fX2 *= (double)mnMillX * 100.0 / (double)mnPixX;
f0633d
-                    fY2 *= (double)mnMillY * 100.0 / (double)mnPixY;
f0633d
-
f0633d
-                    break;
f0633d
                 case MM_LOENGLISH :
f0633d
                 {
f0633d
                     fX2 -= mnWinOrgX;
f0633d
@@ -471,15 +458,6 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
f0633d
         {
f0633d
             switch( mnMapMode )
f0633d
             {
f0633d
-                case MM_TEXT:
f0633d
-                if( mnDevWidth != 1 && mnDevHeight != 1 ) {
f0633d
-                    fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
f0633d
-                    fHeight*= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
f0633d
-                } else {
f0633d
-                    fWidth *= (double)mnMillX * 100 / (double)mnPixX;
f0633d
-                    fHeight *= (double)mnMillY * 100 / (double)mnPixY;
f0633d
-                }
f0633d
-                break;
f0633d
                 case MM_LOENGLISH :
f0633d
                 {
f0633d
                     fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10;
f0633d
@@ -916,7 +894,6 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
f0633d
     mbComplexClip       ( false ),
f0633d
     mnGfxMode           ( GM_COMPATIBLE ),
f0633d
     mnMapMode           ( MM_TEXT ),
f0633d
-    mnUnitsPerInch ( 96 ),
f0633d
     mnDevOrgX           ( 0 ),
f0633d
     mnDevOrgY           ( 0 ),
f0633d
     mnDevWidth          ( 1 ),
f0633d
@@ -2025,7 +2002,7 @@ void WinMtfOutput::SetRefMill( const Size& rSize )
f0633d
 void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
f0633d
 {
f0633d
     mnMapMode = nMapMode;
f0633d
-    if ( nMapMode == MM_TEXT )
f0633d
+    if ( nMapMode == MM_TEXT && !mbIsMapWinSet )
f0633d
     {
f0633d
         mnWinExtX = mnDevWidth;
f0633d
         mnWinExtY = mnDevHeight;
f0633d
@@ -2039,14 +2016,6 @@ void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
f0633d
 
f0633d
 
f0633d
 
f0633d
-void WinMtfOutput::SetUnitsPerInch( sal_uInt16 nUnitsPerInch )
f0633d
-{
f0633d
-    if( nUnitsPerInch != 0 )
f0633d
-    mnUnitsPerInch = nUnitsPerInch;
f0633d
-}
f0633d
-
f0633d
-
f0633d
-
f0633d
 void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
f0633d
 {
f0633d
     maXForm.eM11 = rXForm.eM11;
f0633d
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
f0633d
index bec5d8a..8e18f7e 100644
f0633d
--- a/vcl/source/filter/wmf/winmtf.hxx
f0633d
+++ b/vcl/source/filter/wmf/winmtf.hxx
f0633d
@@ -679,7 +679,6 @@ public:
f0633d
 
f0633d
     sal_uInt32          GetMapMode() const { return mnMapMode; };
f0633d
     void                SetMapMode( sal_uInt32 mnMapMode );
f0633d
-    void                SetUnitsPerInch( sal_uInt16 nUnitsPerInch );
f0633d
     void                SetWorldTransform( const XForm& rXForm );
f0633d
     void                ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode );
f0633d
 
f0633d
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
f0633d
index 84b1a78..3777c3b 100644
f0633d
--- a/vcl/source/filter/wmf/winwmf.cxx
f0633d
+++ b/vcl/source/filter/wmf/winwmf.cxx
f0633d
@@ -1108,7 +1108,6 @@ sal_Bool WMFReader::ReadHeader()
f0633d
         }
f0633d
     }
f0633d
 
f0633d
-    pOut->SetUnitsPerInch( nUnitsPerInch );
f0633d
     pOut->SetWinOrg( aPlaceableBound.TopLeft() );
f0633d
     Size aWMFSize( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) );
f0633d
     pOut->SetWinExt( aWMFSize );
f0633d
-- 
f0633d
1.8.4.2
f0633d