summaryrefslogtreecommitdiff
path: root/vcl/source/window/clipping.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-30 09:38:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-03-30 12:36:05 +0200
commitc6c128b947c8864d6bbd4b0abd1abad16cd0d67e (patch)
tree45b340d9a97b3d0ef35a825d2b2b7d623870a95b /vcl/source/window/clipping.cxx
parentffe6eb528dca34b19fecf738bce647ccb8367379 (diff)
ImplGetWinChildClipRegion never returns null
Change-Id: I3784e47e8584718a51e0fff68382dce833da26f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113340 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window/clipping.cxx')
-rw-r--r--vcl/source/window/clipping.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx
index 7b9330d18505..b5c262df2c1a 100644
--- a/vcl/source/window/clipping.cxx
+++ b/vcl/source/window/clipping.cxx
@@ -45,7 +45,7 @@ void Window::InitClipRegion()
aRegion = *(mpWindowImpl->mpPaintRegion);
else
{
- aRegion = *(ImplGetWinChildClipRegion());
+ aRegion = ImplGetWinChildClipRegion();
// only this region is in frame coordinates, so re-mirror it
// the mpWindowImpl->mpPaintRegion above is already correct (see ImplCallPaint()) !
if( ImplIsAntiparallel() )
@@ -96,7 +96,7 @@ void Window::ExpandPaintClipRegion( const vcl::Region& rRegion )
vcl::Region aPixRegion = LogicToPixel( rRegion );
vcl::Region aDevPixRegion = ImplPixelToDevicePixel( aPixRegion );
- vcl::Region aWinChildRegion = *ImplGetWinChildClipRegion();
+ vcl::Region aWinChildRegion = ImplGetWinChildClipRegion();
// only this region is in frame coordinates, so re-mirror it
if( ImplIsAntiparallel() )
{
@@ -286,19 +286,17 @@ void Window::ImplInitWinChildClipRegion()
mpWindowImpl->mbInitChildRegion = false;
}
-Region* Window::ImplGetWinChildClipRegion()
+Region& Window::ImplGetWinChildClipRegion()
{
if ( mpWindowImpl->mbInitWinClipRegion )
ImplInitWinClipRegion();
if ( mpWindowImpl->mbInitChildRegion )
ImplInitWinChildClipRegion();
if ( mpWindowImpl->mpChildClipRegion )
- return mpWindowImpl->mpChildClipRegion.get();
- else
- return &mpWindowImpl->maWinClipRegion;
+ return *mpWindowImpl->mpChildClipRegion;
+ return mpWindowImpl->maWinClipRegion;
}
-
bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
{
bool bUpdate = true;
@@ -309,18 +307,18 @@ bool Window::ImplSysObjClip( const vcl::Region* pOldRegion )
if ( bVisibleState )
{
- vcl::Region* pWinChildClipRegion = ImplGetWinChildClipRegion();
+ vcl::Region& rWinChildClipRegion = ImplGetWinChildClipRegion();
- if ( !pWinChildClipRegion->IsEmpty() )
+ if (!rWinChildClipRegion.IsEmpty())
{
if ( pOldRegion )
{
- vcl::Region aNewRegion = *pWinChildClipRegion;
- pWinChildClipRegion->Intersect( *pOldRegion );
- bUpdate = aNewRegion == *pWinChildClipRegion;
+ vcl::Region aNewRegion = rWinChildClipRegion;
+ rWinChildClipRegion.Intersect(*pOldRegion);
+ bUpdate = aNewRegion == rWinChildClipRegion;
}
- vcl::Region aRegion = *pWinChildClipRegion;
+ vcl::Region aRegion = rWinChildClipRegion;
vcl::Region aWinRectRegion( GetOutputRectPixel() );
if ( aRegion == aWinRectRegion )