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

Jan Holesovsky kendy at collabora.com
Mon Nov 25 07:05:40 PST 2013


 vcl/source/filter/wmf/winmtf.cxx |   33 +--------------------------------
 vcl/source/filter/wmf/winmtf.hxx |    3 ---
 vcl/source/filter/wmf/winwmf.cxx |    1 -
 3 files changed, 1 insertion(+), 36 deletions(-)

New commits:
commit ec27d36b2adea77201c03ae88ee71ac259e847be
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Nov 21 16:28:32 2013 +0100

    fdo#61272: Do the mapping correctly both for WMF and EMF.
    
    Turns out that for the WMF, we already had everything set up correctly, we
    were just overwriting the right settings with default data again :-) - fix
    that.
    
    Change-Id: I14b0c12b10f58eb7031f9da712dee76344c75159

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 74aed1d..9120b26 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -2006,7 +2006,7 @@ void WinMtfOutput::SetRefMill( const Size& rSize )
 void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
 {
     mnMapMode = nMapMode;
-    if ( nMapMode == MM_TEXT )
+    if ( nMapMode == MM_TEXT && !mbIsMapWinSet )
     {
         mnWinExtX = mnDevWidth;
         mnWinExtY = mnDevHeight;
commit cca0ae43e58f875116fd922c2b70ef6c89305fcf
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Nov 20 21:17:50 2013 +0100

    Related fdo#61272: Revert "wmf-mm-text.diff: Fix WMF rendering, n#417818"
    
    This approach to WMF breaks EMF reading, need to revert it, and fix a
    different way.
    
    This reverts commit db1b08d217ebbdd1b0296e1da260bf314a77acf5.
    
    Conflicts:
    	vcl/source/filter/wmf/winmtf.cxx
    	vcl/source/filter/wmf/winmtf.hxx
    
    Change-Id: I8f779791153f2e1faa086c91b82b3e8b93304f3b

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 2ffde89..74aed1d 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -374,14 +374,6 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
         {
             switch( mnMapMode )
             {
-                case MM_TEXT:
-                    fX2 -= mnWinOrgX;
-                    fY2 -= mnWinOrgY;
-                    fX2 *= 2540.0/mnUnitsPerInch;
-                    fY2 *= 2540.0/mnUnitsPerInch;
-                    fX2 += mnDevOrgX;
-                    fY2 += mnDevOrgY;
-                    break;
                 case MM_LOENGLISH :
                 {
                     fX2 -= mnWinOrgX;
@@ -467,10 +459,6 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
         {
             switch( mnMapMode )
             {
-                case MM_TEXT:
-                    fWidth *= 2540.0/mnUnitsPerInch;
-                    fHeight*= 2540.0/mnUnitsPerInch;
-                break;
                 case MM_LOENGLISH :
                 {
                     fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10;
@@ -907,7 +895,6 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :
     mbComplexClip       ( false ),
     mnGfxMode           ( GM_COMPATIBLE ),
     mnMapMode           ( MM_TEXT ),
-    mnUnitsPerInch ( 96 ),
     mnDevOrgX           ( 0 ),
     mnDevOrgY           ( 0 ),
     mnDevWidth          ( 1 ),
@@ -2033,14 +2020,6 @@ void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode )
 
 
 
-void WinMtfOutput::SetUnitsPerInch( sal_uInt16 nUnitsPerInch )
-{
-    if( nUnitsPerInch != 0 )
-    mnUnitsPerInch = nUnitsPerInch;
-}
-
-
-
 void WinMtfOutput::SetWorldTransform( const XForm& rXForm )
 {
     maXForm.eM11 = rXForm.eM11;
diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx
index 14def6d..46cc80a 100644
--- a/vcl/source/filter/wmf/winmtf.hxx
+++ b/vcl/source/filter/wmf/winmtf.hxx
@@ -589,7 +589,6 @@ struct GDIObj
 
 class WinMtfOutput
 {
-
     WinMtfPathObj       aPathObj;
     WinMtfClipPath      aClipPath;
 
@@ -626,7 +625,6 @@ class WinMtfOutput
 
     sal_uInt32          mnGfxMode;
     sal_uInt32          mnMapMode;
-    sal_uInt16          mnUnitsPerInch;
 
     XForm               maXForm;
     sal_Int32           mnDevOrgX, mnDevOrgY;
@@ -680,7 +678,6 @@ public:
 
     sal_uInt32          GetMapMode() const { return mnMapMode; };
     void                SetMapMode( sal_uInt32 mnMapMode );
-    void                SetUnitsPerInch( sal_uInt16 nUnitsPerInch );
     void                SetWorldTransform( const XForm& rXForm );
     const XForm&        GetWorldTransform() const { return maXForm; }
     void                ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode );
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index ff97d10..f3cfaf2 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1109,7 +1109,6 @@ sal_Bool WMFReader::ReadHeader()
         }
     }
 
-    pOut->SetUnitsPerInch( nUnitsPerInch );
     pOut->SetWinOrg( aPlaceableBound.TopLeft() );
     Size aWMFSize( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) );
     pOut->SetWinExt( aWMFSize );
commit 8614fbc8e68aae5790b7ee06021393ea95e92ed7
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Nov 20 21:11:24 2013 +0100

    Related fdo#61272: Revert "wmf-mm-text-1.diff: Fix WMF rendering, n#417818"
    
    This approach to WMF breaks EMF reading, need to revert it, and fix a
    different way.
    
    This reverts commit 16eaa5e7c1208034bb3244fea9e6d9491ccb5501.
    
    Conflicts:
    	vcl/source/filter/wmf/winmtf.cxx
    
    Change-Id: I59076d0a65d91ba3a1f3ebb48d8f7a542859d351

diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 9986da9..2ffde89 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -377,15 +377,10 @@ Point WinMtfOutput::ImplMap( const Point& rPt )
                 case MM_TEXT:
                     fX2 -= mnWinOrgX;
                     fY2 -= mnWinOrgY;
-                    if( mnDevWidth != 1 || mnDevHeight != 1 ) {
-                        fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
-                        fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
-                    }
+                    fX2 *= 2540.0/mnUnitsPerInch;
+                    fY2 *= 2540.0/mnUnitsPerInch;
                     fX2 += mnDevOrgX;
                     fY2 += mnDevOrgY;
-                    fX2 *= (double)mnMillX * 100.0 / (double)mnPixX;
-                    fY2 *= (double)mnMillY * 100.0 / (double)mnPixY;
-
                     break;
                 case MM_LOENGLISH :
                 {
@@ -473,13 +468,8 @@ Size WinMtfOutput::ImplMap( const Size& rSz )
             switch( mnMapMode )
             {
                 case MM_TEXT:
-                if( mnDevWidth != 1 && mnDevHeight != 1 ) {
-                    fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
-                    fHeight*= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch;
-                } else {
-                    fWidth *= (double)mnMillX * 100 / (double)mnPixX;
-                    fHeight *= (double)mnMillY * 100 / (double)mnPixY;
-                }
+                    fWidth *= 2540.0/mnUnitsPerInch;
+                    fHeight*= 2540.0/mnUnitsPerInch;
                 break;
                 case MM_LOENGLISH :
                 {


More information about the Libreoffice-commits mailing list