diff options
-rw-r--r-- | include/vcl/outdev.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/outdevstate.cxx | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 1df0137cdcee..744f0b0b1f54 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -589,6 +589,7 @@ public: // this should not normally be used since Push and Pop must always be used symmetrically // however this may be e.g. a help when debugging code in which this somehow is not the case sal_uInt32 GetGCStackDepth() const; + void ClearStack(); void EnableOutput( bool bEnable = true ); bool IsOutputEnabled() const { return mbOutput; } diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index e3bdb765438b..d0ef866b2620 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -794,10 +794,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, int nLastBgAction = FindIncompletelyOccludedBackground(aBackgroundComponent, rInMtf, aMapModeVDev.get()); - // clean up aMapModeVDev - sal_uInt32 nCount = aMapModeVDev->GetGCStackDepth(); - while( nCount-- ) - aMapModeVDev->Pop(); + aMapModeVDev->ClearStack(); // clean up aMapModeVDev ::std::vector<ConnectedComponents> aCCList; // contains distinct sets of connected components as elements. @@ -1218,10 +1215,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } } - // clean up aMapModeVDev - nCount = aMapModeVDev->GetGCStackDepth(); - while( nCount-- ) - aMapModeVDev->Pop(); + aMapModeVDev->ClearStack(); // clean up aMapModeVDev // STAGE 4: Copy actions to output metafile diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index ccf92be1932d..a9ca52d9449b 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -225,6 +225,13 @@ sal_uInt32 OutputDevice::GetGCStackDepth() const return maOutDevStateStack.size(); } +void OutputDevice::ClearStack() +{ + sal_uInt32 nCount = GetGCStackDepth(); + while( nCount-- ) + Pop(); +} + void OutputDevice::EnableOutput( bool bEnable ) { mbOutput = bEnable; |