diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/print.cxx | 7 | ||||
-rw-r--r-- | vcl/source/gdi/print2.cxx | 11 | ||||
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 5 |
3 files changed, 13 insertions, 10 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 364f0af35587..7c8a68892708 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -316,6 +316,13 @@ void Printer::CopyArea( const Point& /*rDestPt*/, SAL_WARN( "vcl.gdi", "Don't use OutputDevice::CopyArea(...) with printer devices!" ); } +tools::Rectangle Printer::SetBackgroundComponentBounds() +{ + Point aPageOffset = Point( 0, 0 ) - this->GetPageOffsetPixel(); + Size aSize = this->GetPaperSizePixel(); + return tools::Rectangle( aPageOffset, aSize ); +} + void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions ) { *mpPrinterOptions = i_rOptions; diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index db4b6dd0af72..b51318c8ea83 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -748,16 +748,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, if( rBackground != COL_TRANSPARENT ) { aBackgroundComponent.aBgColor = rBackground; - if( meOutDevType == OUTDEV_PRINTER ) - { - Printer* pThis = dynamic_cast<Printer*>(this); - assert(pThis); - Point aPageOffset = Point( 0, 0 ) - pThis->GetPageOffsetPixel(); - Size aSize = pThis->GetPaperSizePixel(); - aBackgroundComponent.aBounds = tools::Rectangle( aPageOffset, aSize ); - } - else - aBackgroundComponent.aBounds = tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() ); + aBackgroundComponent.aBounds = SetBackgroundComponentBounds(); } while( pCurrAct && bStillBackground ) { diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 880181cb5407..0dcdd84a5d0a 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -579,6 +579,11 @@ void OutputDevice::DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoR mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev ); } +tools::Rectangle OutputDevice::SetBackgroundComponentBounds() +{ + return tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() ); +} + // Layout public functions void OutputDevice::EnableRTL( bool bEnable ) |