fdo#72590 scale or map only when EMR_EXTSELECTCLIPRGN action

Change-Id: Ie42c855e696922b38760876d4090d572deaa689a
This commit is contained in:
Tomaž Vajngerl
2014-05-18 23:30:39 +02:00
parent 10cd55677c
commit fc83bf8bbf
2 changed files with 22 additions and 25 deletions

View File

@@ -1000,21 +1000,21 @@ bool EnhWMFReader::ReadEnhWMF()
case EMR_SELECTCLIPPATH : case EMR_SELECTCLIPPATH :
{ {
sal_Int32 nClippingMode; sal_Int32 nClippingMode;
pWMF->ReadInt32( nClippingMode ); pWMF->ReadInt32(nClippingMode);
pOut->SetClipPath( pOut->GetPathObj(), nClippingMode, true ); pOut->SetClipPath(pOut->GetPathObj(), nClippingMode, true);
} }
break; break;
case EMR_EXTSELECTCLIPRGN : case EMR_EXTSELECTCLIPRGN :
{ {
sal_Int32 iMode, cbRgnData; sal_Int32 nClippingMode, cbRgnData;
pWMF->ReadInt32( cbRgnData ) pWMF->ReadInt32(cbRgnData);
.ReadInt32( iMode ); pWMF->ReadInt32(nClippingMode);
PolyPolygon aPolyPoly; PolyPolygon aPolyPoly;
if ( cbRgnData ) if (cbRgnData)
ImplReadRegion( aPolyPoly, *pWMF, nRecSize ); ImplReadRegion(aPolyPoly, *pWMF, nRecSize);
pOut->SetClipPath( aPolyPoly, iMode, true ); pOut->SetClipPath(aPolyPoly, nClippingMode, false);
} }
break; break;

View File

@@ -294,16 +294,13 @@ Color WinMtf::ReadColor()
return Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) ); 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) if (!mbIsMapDevSet)
return rPt; //fdo#73764 return Point(rPoint.X() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Left(),
rPoint.Y() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Top());
if (mbIsMapWinSet) else
return Point(rPt.X() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Left(), return rPoint;
rPt.Y() * UNDOCUMENTED_WIN_RCL_RELATION - mrclFrame.Top());
return ImplMap(rPt);
} }
Point WinMtfOutput::ImplMap( const Point& rPt ) 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 ) void WinMtfOutput::SetClipPath( const PolyPolygon& rPolyPolygon, sal_Int32 nClippingMode, bool bIsMapped )
{ {
mbClipNeedsUpdate = true; mbClipNeedsUpdate = true;
if (bIsMapped) PolyPolygon aPolyPolygon(rPolyPolygon);
if (!bIsMapped)
{ {
PolyPolygon aPP( rPolyPolygon ); if (!mbIsMapDevSet && (mnMapMode == MM_ISOTROPIC || mnMapMode == MM_ANISOTROPIC))
aClipPath.setClipPath( ImplScale( aPP ), nClippingMode ); aPolyPolygon = ImplScale(aPolyPolygon);
} else
else aPolyPolygon = ImplMap(aPolyPolygon);
{
PolyPolygon aPP( rPolyPolygon );
aClipPath.setClipPath( ImplMap( aPP ), nClippingMode );
} }
aClipPath.setClipPath(aPolyPolygon, nClippingMode);
} }
WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) :