summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-01 23:40:05 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-01 13:34:27 +0000
commit04e08fa4aa419b8d89d80a39e6904bc4cd8883be (patch)
treee4aefea0c2f410be647157f73cc87867a55bf8b7
parentcoverity#735505 Logically dead code (diff)
downloadcore-04e08fa4aa419b8d89d80a39e6904bc4cd8883be.tar.gz
core-04e08fa4aa419b8d89d80a39e6904bc4cd8883be.zip
fdo#74702 Refactor code to use ClipToPaintRegion()
There is a fair amount of code that should use ClipToPaintRegion(). Not only does this remove meOutDevType and decouples classes, but we are using code, so code reuse FTW. Change-Id: I05a2623b73f4a523230dc01d02db33a6df9911ab Reviewed-on: https://gerrit.libreoffice.org/8810 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
-rw-r--r--vcl/source/gdi/outdev4.cxx8
-rw-r--r--vcl/source/gdi/outdev6.cxx16
2 files changed, 3 insertions, 21 deletions
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 4d23620013c4..0810e6b32f66 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -852,13 +852,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
aDstRect.Intersection( aBoundRect );
- if( OUTDEV_WINDOW == meOutDevType )
- {
- const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
-
- if( !aPaintRgn.IsNull() )
- aDstRect.Intersection( LogicToPixel( aPaintRgn ).GetBoundRect() );
- }
+ ClipToPaintRegion( aDstRect );
if( !aDstRect.IsEmpty() )
{
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 0234df345d8d..d96e59fa9ef5 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -346,13 +346,7 @@ void OutputDevice::EmulateDrawTransparent ( const PolyPolygon& rPolyPoly,
aDstRect.Intersection( aPolyRect );
- if( OUTDEV_WINDOW == meOutDevType )
- {
- const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
-
- if( !aPaintRgn.IsNull() )
- aDstRect.Intersection( LogicToPixel( aPaintRgn ).GetBoundRect() );
- }
+ ClipToPaintRegion( aDstRect );
if( !aDstRect.IsEmpty() )
{
@@ -632,13 +626,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
mpMetaFile = NULL;
aDstRect.Intersection( aOutRect );
- if( OUTDEV_WINDOW == meOutDevType )
- {
- const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
-
- if( !aPaintRgn.IsNull() )
- aDstRect.Intersection( LogicToPixel( aPaintRgn.GetBoundRect() ) );
- }
+ ClipToPaintRegion( aDstRect );
if( !aDstRect.IsEmpty() )
{