summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-25 03:08:37 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-25 03:18:09 +1000
commit66b2880ad51b69188ea5c2e56a682ed320c53d1e (patch)
tree0a00669cc7aa6aac654b1f1f2232956a894f98d5 /vcl
parentba0bb5ef675ccae12ca9e7ae3ec6a194b0cc8533 (diff)
fdo#74702 Move GetActiveClipRegion code into Window
Window checks to see if the window is currently being painted, then it checks to see if there is an active clipping region (which it needs to intersect with). Printer and VirtualDevice don't have this need, so they just return the clipping region. Change-Id: I1a9af237940f5add725c783c02a193c9e3329fa6
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/outdev/clipping.cxx17
-rw-r--r--vcl/source/window/window.cxx16
2 files changed, 17 insertions, 16 deletions
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index a1e3526fd4b6..299c272e3262 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -167,22 +167,7 @@ Region OutputDevice::GetClipRegion() const
Region OutputDevice::GetActiveClipRegion() const
{
-
- if ( GetOutDevType() == OUTDEV_WINDOW )
- {
- Region aRegion(true);
- Window* pWindow = (Window*)this;
- if ( pWindow->mpWindowImpl->mbInPaint )
- {
- aRegion = *(pWindow->mpWindowImpl->mpPaintRegion);
- aRegion.Move( -mnOutOffX, -mnOutOffY );
- }
- if ( mbClipRegion )
- aRegion.Intersect( maRegion );
- return PixelToLogic( aRegion );
- }
- else
- return GetClipRegion();
+ return GetClipRegion();
}
void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e65fe3824608..a4fe2037f7a0 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -439,6 +439,22 @@ void Window::InitClipRegion()
mbInitClipRegion = false;
}
+Region Window::GetActiveClipRegion() const
+{
+ Region aRegion(true);
+
+ if ( mpWindowImpl->mbInPaint )
+ {
+ aRegion = *(mpWindowImpl->mpPaintRegion);
+ aRegion.Move( -mnOutOffX, -mnOutOffY );
+ }
+
+ if ( mbClipRegion )
+ aRegion.Intersect( maRegion );
+
+ return PixelToLogic( aRegion );
+}
+
void Window::EnableRTL ( bool bEnable )
{
StateChanged( STATE_CHANGE_MIRRORING );