diff options
Diffstat (limited to 'vcl/source/gdi/print2.cxx')
-rw-r--r-- | vcl/source/gdi/print2.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 01bf4ca90d65..d86df6e2816b 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -855,13 +855,12 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, ++nActionNum; } - ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements. + // clean up aMapModeVDev + sal_uInt32 nCount = aMapModeVDev.GetGCStackDepth(); + while( nCount-- ) + aMapModeVDev.Pop(); - // create an OutputDevice to record mapmode changes and the like - VirtualDevice aMapModeVDev2; - aMapModeVDev2.mnDPIX = mnDPIX; - aMapModeVDev2.mnDPIY = mnDPIY; - aMapModeVDev2.EnableOutput(sal_False); + ConnectedComponentsList aCCList; // list containing distinct sets of connected components as elements. // fast-forward until one after the last background action // (need to reconstruct map mode vdev state) @@ -876,7 +875,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, pCurrAct, nActionNum) ); // execute action to get correct MapModes etc. - pCurrAct->Execute( &aMapModeVDev2 ); + pCurrAct->Execute( &aMapModeVDev ); pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(); ++nActionNum; } @@ -893,10 +892,10 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, pCurrAct=const_cast<GDIMetaFile&>(rInMtf).NextAction(), ++nActionNum ) { // execute action to get correct MapModes etc. - pCurrAct->Execute( &aMapModeVDev2 ); + pCurrAct->Execute( &aMapModeVDev ); // cache bounds of current action - const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev2) ); + const Rectangle aBBCurrAct( ImplCalcActionBounds(*pCurrAct, aMapModeVDev) ); // accumulate collected bounds here, initialize with current action Rectangle aTotalBounds( aBBCurrAct ); // thus, @@ -925,7 +924,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, // not be considered for connected components, // too. Just put each of them into a separate // component. - aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev2); + aTotalComponents.bIsFullyTransparent = !ImplIsNotTransparent(*pCurrAct, aMapModeVDev); if( !aBBCurrAct.IsEmpty() && !aTotalComponents.bIsFullyTransparent ) @@ -1311,18 +1310,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } } + // clean up aMapModeVDev + nCount = aMapModeVDev.GetGCStackDepth(); + while( nCount-- ) + aMapModeVDev.Pop(); + // // STAGE 4: Copy actions to output metafile // ======================================== // - // create an OutputDevice to record color settings, mapmode - // changes and the like - VirtualDevice aMapModeVDev3; - aMapModeVDev3.mnDPIX = mnDPIX; - aMapModeVDev3.mnDPIY = mnDPIY; - aMapModeVDev3.EnableOutput(sal_False); - // iterate over all actions and duplicate the ones not in a // special aCCList member into rOutMtf for( pCurrAct=const_cast<GDIMetaFile&>(rInMtf).FirstAction(), nActionNum=0; @@ -1350,7 +1347,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, // given background color ImplConvertTransparentAction(rOutMtf, *pCurrAct, - aMapModeVDev3, + aMapModeVDev, aBackgroundComponent.aBgColor); } else @@ -1359,7 +1356,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) ); } - pCurrAct->Execute(&aMapModeVDev3); + pCurrAct->Execute(&aMapModeVDev); } } |