diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-05-18 23:30:39 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-05-19 00:01:15 +0200 |
commit | fc83bf8bbf813fff1cb7c0b7925976bc43a49f94 (patch) | |
tree | da89518d6c8c23d34e89a960b0f6c55f5418514c /vcl | |
parent | vcl wmf: EnhWMFReader more cleanup (diff) | |
download | core-fc83bf8bbf813fff1cb7c0b7925976bc43a49f94.tar.gz core-fc83bf8bbf813fff1cb7c0b7925976bc43a49f94.zip |
fdo#72590 scale or map only when EMR_EXTSELECTCLIPRGN action
Change-Id: Ie42c855e696922b38760876d4090d572deaa689a
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/wmf/enhwmf.cxx | 16 | ||||
-rw-r--r-- | vcl/source/filter/wmf/winmtf.cxx | 31 |
2 files changed, 22 insertions, 25 deletions
diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index a8858d36100d..4047093865ea 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -1000,21 +1000,21 @@ bool EnhWMFReader::ReadEnhWMF() case EMR_SELECTCLIPPATH : { sal_Int32 nClippingMode; - pWMF->ReadInt32( nClippingMode ); - pOut->SetClipPath( pOut->GetPathObj(), nClippingMode, true ); + pWMF->ReadInt32(nClippingMode); + pOut->SetClipPath(pOut->GetPathObj(), nClippingMode, true); } break; case EMR_EXTSELECTCLIPRGN : { - sal_Int32 iMode, cbRgnData; - pWMF->ReadInt32( cbRgnData ) - .ReadInt32( iMode ); + sal_Int32 nClippingMode, cbRgnData; + pWMF->ReadInt32(cbRgnData); + pWMF->ReadInt32(nClippingMode); PolyPolygon aPolyPoly; - if ( cbRgnData ) - ImplReadRegion( aPolyPoly, *pWMF, nRecSize ); - pOut->SetClipPath( aPolyPoly, iMode, true ); + if (cbRgnData) + ImplReadRegion(aPolyPoly, *pWMF, nRecSize); + pOut->SetClipPath(aPolyPoly, nClippingMode, false); } break; diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index 0a7f8c4dff43..48ba6b11bd3c 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -294,16 +294,13 @@ Color WinMtf::ReadColor() return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) ); }; -Point WinMtfOutput::ImplScale( const Point& rPt) // Hack to set varying defaults for incompletely defined files. +Point WinMtfOutput::ImplScale(const Point& rPoint) // Hack to set varying defaults for incompletely defined files. { - if (mbIsMapDevSet) - return rPt; //fdo#73764 - - if (mbIsMapWinSet) - return Point(rPt.X() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Left(), - rPt.Y() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Top()); - - return ImplMap(rPt); + if (!mbIsMapDevSet) + return Point(rPoint.X() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Left(), + rPoint.Y() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Top()); + else + return rPoint; } Point WinMtfOutput::ImplMap( const Point& rPt ) @@ -782,16 +779,16 @@ void WinMtfOutput::MoveClipRegion( const Size& rSize ) void WinMtfOutput::SetClipPath( const PolyPolygon& rPolyPolygon, sal_Int32 nClippingMode, bool bIsMapped ) { mbClipNeedsUpdate = true; - if (bIsMapped) - { - PolyPolygon aPP( rPolyPolygon ); - aClipPath.setClipPath( ImplScale( aPP ), nClippingMode ); - } - else + PolyPolygon aPolyPolygon(rPolyPolygon); + + if (!bIsMapped) { - PolyPolygon aPP( rPolyPolygon ); - aClipPath.setClipPath( ImplMap( aPP ), nClippingMode ); + if (!mbIsMapDevSet && (mnMapMode == MM_ISOTROPIC || mnMapMode == MM_ANISOTROPIC)) + aPolyPolygon = ImplScale(aPolyPolygon); + else + aPolyPolygon = ImplMap(aPolyPolygon); } + aClipPath.setClipPath(aPolyPolygon, nClippingMode); } WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : |