diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-06-02 09:02:06 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-07-19 23:40:54 +1000 |
commit | cc41d52af226f6c4fdfd8e300b81d0f61d633053 (patch) | |
tree | cfc7e19f59e4a58a6e8b963500ad55142e5d7f2f | |
parent | c0a9ecb6aec9f9bb00e07d8170e728deaa1d9ffc (diff) |
vcl: use Set/GetParentClipMode through ClipManager
Change-Id: Ib8bb0101053ca64f59a23c1fdb14ee444f3342db
-rw-r--r-- | vcl/inc/clipmgr.hxx | 3 | ||||
-rw-r--r-- | vcl/source/window/clipmgr.cxx | 24 | ||||
-rw-r--r-- | vcl/source/window/clipping.cxx | 20 |
3 files changed, 30 insertions, 17 deletions
diff --git a/vcl/inc/clipmgr.hxx b/vcl/inc/clipmgr.hxx index 0e5829241ef7..26b9bebd0262 100644 --- a/vcl/inc/clipmgr.hxx +++ b/vcl/inc/clipmgr.hxx @@ -44,6 +44,9 @@ public: ~ClipManager() { instanceFlag = false; } static ClipManager *GetInstance(); + void SetParentClipMode( Window* pWindow, sal_uInt16 nMode ); + sal_uInt16 GetParentClipMode( Window* pWindow ) const; + bool IsOverlapWindow( Window* pWindow ) const; void InitClipRegion( Window *pWindow ); diff --git a/vcl/source/window/clipmgr.cxx b/vcl/source/window/clipmgr.cxx index f26392669ec0..8159a5bcf9b0 100644 --- a/vcl/source/window/clipmgr.cxx +++ b/vcl/source/window/clipmgr.cxx @@ -44,6 +44,30 @@ ClipManager* ClipManager::GetInstance() } } +void ClipManager::SetParentClipMode( Window* pWindow, sal_uInt16 nMode ) +{ + if ( pWindow->mpWindowImpl->mpBorderWindow ) + pWindow->mpWindowImpl->mpBorderWindow->SetParentClipMode( nMode ); + else + { + if ( IsOverlapWindow( pWindow ) ) + { + pWindow->mpWindowImpl->mnParentClipMode = nMode; + if ( nMode & PARENTCLIPMODE_CLIP ) + pWindow->mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = true; + } + } +} + +sal_uInt16 ClipManager::GetParentClipMode( Window* pWindow ) const +{ + + if ( pWindow->mpWindowImpl->mpBorderWindow ) + return GetParentClipMode( pWindow->mpWindowImpl->mpBorderWindow ); + else + return pWindow->mpWindowImpl->mnParentClipMode; +} + void ClipManager::InitClipRegion( Window *pWindow ) { // Build Window region diff --git a/vcl/source/window/clipping.cxx b/vcl/source/window/clipping.cxx index 0d5beb9a184e..c0de87c40732 100644 --- a/vcl/source/window/clipping.cxx +++ b/vcl/source/window/clipping.cxx @@ -67,27 +67,13 @@ void Window::InitClipRegion() void Window::SetParentClipMode( sal_uInt16 nMode ) { ClipManager *clipMgr = ClipManager::GetInstance(); - - if ( mpWindowImpl->mpBorderWindow ) - mpWindowImpl->mpBorderWindow->SetParentClipMode( nMode ); - else - { - if ( !clipMgr->IsOverlapWindow( this ) ) - { - mpWindowImpl->mnParentClipMode = nMode; - if ( nMode & PARENTCLIPMODE_CLIP ) - mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = true; - } - } + clipMgr->SetParentClipMode( this, nMode ); } sal_uInt16 Window::GetParentClipMode() const { - - if ( mpWindowImpl->mpBorderWindow ) - return mpWindowImpl->mpBorderWindow->GetParentClipMode(); - else - return mpWindowImpl->mnParentClipMode; + ClipManager *clipMgr = ClipManager::GetInstance(); + return clipMgr->GetParentClipMode( const_cast<Window*>(this) ); } void Window::ExpandPaintClipRegion( const Region& rRegion ) |