summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-28 19:18:25 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-28 20:13:55 +1000
commitdb5be2d4ca6867c61cb9fe117d7b76281240d739 (patch)
treeb4f2b7774de5aec4f8003fee0ed2ab8eafcb345a /vcl
parentc91554fbca5b2e7977a8ae12e64725f31eca87d1 (diff)
VCL: Move Push and Pop from outdev.cxx to outdevstate.cxx
Change-Id: I98076c6e23b69b2e59dcca9fbc35a3a9755e564c
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/outdev.cxx185
-rw-r--r--vcl/source/outdev/outdevstate.cxx187
2 files changed, 187 insertions, 185 deletions
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 92fe33d96356..cb1af8591ea9 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -243,191 +243,6 @@ OutputDevice::~OutputDevice()
delete mpAlphaVDev;
}
-void OutputDevice::Push( sal_uInt16 nFlags )
-{
-
- if ( mpMetaFile )
- mpMetaFile->AddAction( new MetaPushAction( nFlags ) );
-
- OutDevState* pState = new OutDevState;
-
- pState->mnFlags = nFlags;
-
- if ( nFlags & PUSH_LINECOLOR )
- {
- if ( mbLineColor )
- pState->mpLineColor = new Color( maLineColor );
- else
- pState->mpLineColor = NULL;
- }
- if ( nFlags & PUSH_FILLCOLOR )
- {
- if ( mbFillColor )
- pState->mpFillColor = new Color( maFillColor );
- else
- pState->mpFillColor = NULL;
- }
- if ( nFlags & PUSH_FONT )
- pState->mpFont = new Font( maFont );
- if ( nFlags & PUSH_TEXTCOLOR )
- pState->mpTextColor = new Color( GetTextColor() );
- if ( nFlags & PUSH_TEXTFILLCOLOR )
- {
- if ( IsTextFillColor() )
- pState->mpTextFillColor = new Color( GetTextFillColor() );
- else
- pState->mpTextFillColor = NULL;
- }
- if ( nFlags & PUSH_TEXTLINECOLOR )
- {
- if ( IsTextLineColor() )
- pState->mpTextLineColor = new Color( GetTextLineColor() );
- else
- pState->mpTextLineColor = NULL;
- }
- if ( nFlags & PUSH_OVERLINECOLOR )
- {
- if ( IsOverlineColor() )
- pState->mpOverlineColor = new Color( GetOverlineColor() );
- else
- pState->mpOverlineColor = NULL;
- }
- if ( nFlags & PUSH_TEXTALIGN )
- pState->meTextAlign = GetTextAlign();
- if( nFlags & PUSH_TEXTLAYOUTMODE )
- pState->mnTextLayoutMode = GetLayoutMode();
- if( nFlags & PUSH_TEXTLANGUAGE )
- pState->meTextLanguage = GetDigitLanguage();
- if ( nFlags & PUSH_RASTEROP )
- pState->meRasterOp = GetRasterOp();
- if ( nFlags & PUSH_MAPMODE )
- {
- pState->mpMapMode = new MapMode( maMapMode );
- pState->mbMapActive = mbMap;
- }
- if ( nFlags & PUSH_CLIPREGION )
- {
- if ( mbClipRegion )
- pState->mpClipRegion = new Region( maRegion );
- else
- pState->mpClipRegion = NULL;
- }
- if ( nFlags & PUSH_REFPOINT )
- {
- if ( mbRefPoint )
- pState->mpRefPoint = new Point( maRefPoint );
- else
- pState->mpRefPoint = NULL;
- }
-
- mpOutDevStateStack->push_back( pState );
-
- if( mpAlphaVDev )
- mpAlphaVDev->Push();
-}
-
-void OutputDevice::Pop()
-{
-
- if( mpMetaFile )
- mpMetaFile->AddAction( new MetaPopAction() );
-
- GDIMetaFile* pOldMetaFile = mpMetaFile;
- mpMetaFile = NULL;
-
- if ( mpOutDevStateStack->empty() )
- {
- SAL_WARN( "vcl.gdi", "OutputDevice::Pop() without OutputDevice::Push()" );
- return;
- }
- const OutDevState& rState = mpOutDevStateStack->back();
-
- if( mpAlphaVDev )
- mpAlphaVDev->Pop();
-
- if ( rState.mnFlags & PUSH_LINECOLOR )
- {
- if ( rState.mpLineColor )
- SetLineColor( *rState.mpLineColor );
- else
- SetLineColor();
- }
-
- if ( rState.mnFlags & PUSH_FILLCOLOR )
- {
- if ( rState.mpFillColor )
- SetFillColor( *rState.mpFillColor );
- else
- SetFillColor();
- }
-
- if ( rState.mnFlags & PUSH_FONT )
- SetFont( *rState.mpFont );
-
- if ( rState.mnFlags & PUSH_TEXTCOLOR )
- SetTextColor( *rState.mpTextColor );
-
- if ( rState.mnFlags & PUSH_TEXTFILLCOLOR )
- {
- if ( rState.mpTextFillColor )
- SetTextFillColor( *rState.mpTextFillColor );
- else
- SetTextFillColor();
- }
-
- if ( rState.mnFlags & PUSH_TEXTLINECOLOR )
- {
- if ( rState.mpTextLineColor )
- SetTextLineColor( *rState.mpTextLineColor );
- else
- SetTextLineColor();
- }
-
- if ( rState.mnFlags & PUSH_OVERLINECOLOR )
- {
- if ( rState.mpOverlineColor )
- SetOverlineColor( *rState.mpOverlineColor );
- else
- SetOverlineColor();
- }
-
- if ( rState.mnFlags & PUSH_TEXTALIGN )
- SetTextAlign( rState.meTextAlign );
-
- if( rState.mnFlags & PUSH_TEXTLAYOUTMODE )
- SetLayoutMode( rState.mnTextLayoutMode );
-
- if( rState.mnFlags & PUSH_TEXTLANGUAGE )
- SetDigitLanguage( rState.meTextLanguage );
-
- if ( rState.mnFlags & PUSH_RASTEROP )
- SetRasterOp( rState.meRasterOp );
-
- if ( rState.mnFlags & PUSH_MAPMODE )
- {
- if ( rState.mpMapMode )
- SetMapMode( *rState.mpMapMode );
- else
- SetMapMode();
- mbMap = rState.mbMapActive;
- }
-
- if ( rState.mnFlags & PUSH_CLIPREGION )
- SetDeviceClipRegion( rState.mpClipRegion );
-
- if ( rState.mnFlags & PUSH_REFPOINT )
- {
- if ( rState.mpRefPoint )
- SetRefPoint( *rState.mpRefPoint );
- else
- SetRefPoint();
- }
-
- mpOutDevStateStack->pop_back();
-
- mpMetaFile = pOldMetaFile;
-}
-
bool OutputDevice::SupportsOperation( OutDevSupportType eType ) const
{
if( !mpGraphics )
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx
index 64cb97bd4c2e..23683e7f614e 100644
--- a/vcl/source/outdev/outdevstate.cxx
+++ b/vcl/source/outdev/outdevstate.cxx
@@ -63,6 +63,193 @@ OutDevState::~OutDevState()
delete mpRefPoint;
}
+
+void OutputDevice::Push( sal_uInt16 nFlags )
+{
+
+ if ( mpMetaFile )
+ mpMetaFile->AddAction( new MetaPushAction( nFlags ) );
+
+ OutDevState* pState = new OutDevState;
+
+ pState->mnFlags = nFlags;
+
+ if ( nFlags & PUSH_LINECOLOR )
+ {
+ if ( mbLineColor )
+ pState->mpLineColor = new Color( maLineColor );
+ else
+ pState->mpLineColor = NULL;
+ }
+ if ( nFlags & PUSH_FILLCOLOR )
+ {
+ if ( mbFillColor )
+ pState->mpFillColor = new Color( maFillColor );
+ else
+ pState->mpFillColor = NULL;
+ }
+ if ( nFlags & PUSH_FONT )
+ pState->mpFont = new Font( maFont );
+ if ( nFlags & PUSH_TEXTCOLOR )
+ pState->mpTextColor = new Color( GetTextColor() );
+ if ( nFlags & PUSH_TEXTFILLCOLOR )
+ {
+ if ( IsTextFillColor() )
+ pState->mpTextFillColor = new Color( GetTextFillColor() );
+ else
+ pState->mpTextFillColor = NULL;
+ }
+ if ( nFlags & PUSH_TEXTLINECOLOR )
+ {
+ if ( IsTextLineColor() )
+ pState->mpTextLineColor = new Color( GetTextLineColor() );
+ else
+ pState->mpTextLineColor = NULL;
+ }
+ if ( nFlags & PUSH_OVERLINECOLOR )
+ {
+ if ( IsOverlineColor() )
+ pState->mpOverlineColor = new Color( GetOverlineColor() );
+ else
+ pState->mpOverlineColor = NULL;
+ }
+ if ( nFlags & PUSH_TEXTALIGN )
+ pState->meTextAlign = GetTextAlign();
+ if( nFlags & PUSH_TEXTLAYOUTMODE )
+ pState->mnTextLayoutMode = GetLayoutMode();
+ if( nFlags & PUSH_TEXTLANGUAGE )
+ pState->meTextLanguage = GetDigitLanguage();
+ if ( nFlags & PUSH_RASTEROP )
+ pState->meRasterOp = GetRasterOp();
+ if ( nFlags & PUSH_MAPMODE )
+ {
+ pState->mpMapMode = new MapMode( maMapMode );
+ pState->mbMapActive = mbMap;
+ }
+ if ( nFlags & PUSH_CLIPREGION )
+ {
+ if ( mbClipRegion )
+ pState->mpClipRegion = new Region( maRegion );
+ else
+ pState->mpClipRegion = NULL;
+ }
+ if ( nFlags & PUSH_REFPOINT )
+ {
+ if ( mbRefPoint )
+ pState->mpRefPoint = new Point( maRefPoint );
+ else
+ pState->mpRefPoint = NULL;
+ }
+
+ mpOutDevStateStack->push_back( pState );
+
+ if( mpAlphaVDev )
+ mpAlphaVDev->Push();
+}
+
+void OutputDevice::Pop()
+{
+
+ if( mpMetaFile )
+ mpMetaFile->AddAction( new MetaPopAction() );
+
+ GDIMetaFile* pOldMetaFile = mpMetaFile;
+ mpMetaFile = NULL;
+
+ if ( mpOutDevStateStack->empty() )
+ {
+ SAL_WARN( "vcl.gdi", "OutputDevice::Pop() without OutputDevice::Push()" );
+ return;
+ }
+ const OutDevState& rState = mpOutDevStateStack->back();
+
+ if( mpAlphaVDev )
+ mpAlphaVDev->Pop();
+
+ if ( rState.mnFlags & PUSH_LINECOLOR )
+ {
+ if ( rState.mpLineColor )
+ SetLineColor( *rState.mpLineColor );
+ else
+ SetLineColor();
+ }
+
+ if ( rState.mnFlags & PUSH_FILLCOLOR )
+ {
+ if ( rState.mpFillColor )
+ SetFillColor( *rState.mpFillColor );
+ else
+ SetFillColor();
+ }
+
+ if ( rState.mnFlags & PUSH_FONT )
+ SetFont( *rState.mpFont );
+
+ if ( rState.mnFlags & PUSH_TEXTCOLOR )
+ SetTextColor( *rState.mpTextColor );
+
+ if ( rState.mnFlags & PUSH_TEXTFILLCOLOR )
+ {
+ if ( rState.mpTextFillColor )
+ SetTextFillColor( *rState.mpTextFillColor );
+ else
+ SetTextFillColor();
+ }
+
+ if ( rState.mnFlags & PUSH_TEXTLINECOLOR )
+ {
+ if ( rState.mpTextLineColor )
+ SetTextLineColor( *rState.mpTextLineColor );
+ else
+ SetTextLineColor();
+ }
+
+ if ( rState.mnFlags & PUSH_OVERLINECOLOR )
+ {
+ if ( rState.mpOverlineColor )
+ SetOverlineColor( *rState.mpOverlineColor );
+ else
+ SetOverlineColor();
+ }
+
+ if ( rState.mnFlags & PUSH_TEXTALIGN )
+ SetTextAlign( rState.meTextAlign );
+
+ if( rState.mnFlags & PUSH_TEXTLAYOUTMODE )
+ SetLayoutMode( rState.mnTextLayoutMode );
+
+ if( rState.mnFlags & PUSH_TEXTLANGUAGE )
+ SetDigitLanguage( rState.meTextLanguage );
+
+ if ( rState.mnFlags & PUSH_RASTEROP )
+ SetRasterOp( rState.meRasterOp );
+
+ if ( rState.mnFlags & PUSH_MAPMODE )
+ {
+ if ( rState.mpMapMode )
+ SetMapMode( *rState.mpMapMode );
+ else
+ SetMapMode();
+ mbMap = rState.mbMapActive;
+ }
+
+ if ( rState.mnFlags & PUSH_CLIPREGION )
+ SetDeviceClipRegion( rState.mpClipRegion );
+
+ if ( rState.mnFlags & PUSH_REFPOINT )
+ {
+ if ( rState.mpRefPoint )
+ SetRefPoint( *rState.mpRefPoint );
+ else
+ SetRefPoint();
+ }
+
+ mpOutDevStateStack->pop_back();
+
+ mpMetaFile = pOldMetaFile;
+}
+
+
void OutputDevice::InitFillColor()
{
DBG_TESTSOLARMUTEX();