summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-01-03 22:00:32 +0000
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-04 17:22:38 +0000
commitf7879b26ea7ab04d4e8bbfcc2ca2439c13a0504f (patch)
treed792a87f06826f07641fb3b82088840d8620cec7 /vcl/source
parentd66a9721913e89f1cc76068ee1a64b1cf0eef8d8 (diff)
vcl: hold VclPtrs to avoid possible lifecycle related crashers.
Makes code on common EnableInput crash reporter trace safer. Change-Id: Ibcf218d0d2460383d12e19f48aaf0ab08e541532 Reviewed-on: https://gerrit.libreoffice.org/32706 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 61aa97c1be23398acb7e9160763b621f63c13d88) Reviewed-on: https://gerrit.libreoffice.org/32719 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/window.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ac89e1cc115d..e483e2952b7c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1408,7 +1408,7 @@ bool Window::ImplUpdatePos()
mnOutOffY = mpWindowImpl->mnY + pParent->mnOutOffY;
}
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
if ( pChild->ImplUpdatePos() )
@@ -1427,7 +1427,7 @@ void Window::ImplUpdateSysObjPos()
if ( mpWindowImpl->mpSysObj )
mpWindowImpl->mpSysObj->SetPosSize( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight );
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->ImplUpdateSysObjPos();
@@ -1957,7 +1957,7 @@ bool Window::IsLocked() const
if ( mpWindowImpl->mnLockCount != 0 )
return true;
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr<vcl::Window> pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
if ( pChild->IsLocked() )
@@ -2156,7 +2156,7 @@ void Window::CollectChildren(::std::vector<vcl::Window *>& rAllChildren )
{
rAllChildren.push_back( this );
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->CollectChildren( rAllChildren );
@@ -2470,7 +2470,7 @@ void Window::Enable( bool bEnable, bool bChild )
if ( bChild )
{
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->Enable( bEnable, bChild );
@@ -2486,7 +2486,7 @@ void Window::SetCallHandlersOnInputDisabled( bool bCall )
{
mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall;
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->SetCallHandlersOnInputDisabled( bCall );
@@ -2543,7 +2543,7 @@ void Window::EnableInput( bool bEnable, bool bChild )
if ( bChild )
{
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->EnableInput( bEnable, bChild );
@@ -2642,7 +2642,7 @@ void Window::AlwaysEnableInput( bool bAlways, bool bChild )
if ( bChild )
{
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->AlwaysEnableInput( bAlways, bChild );
@@ -2671,7 +2671,7 @@ void Window::AlwaysDisableInput( bool bAlways, bool bChild )
if ( bChild )
{
- vcl::Window* pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
{
pChild->AlwaysDisableInput( bAlways, bChild );
@@ -3415,7 +3415,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect,
bool Window::IsScrollable() const
{
// check for scrollbars
- vcl::Window *pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
if( pChild->GetType() == WINDOW_SCROLLBAR )
@@ -3488,14 +3488,14 @@ bool Window::HasActiveChildFrame()
if( pFrameWin != mpWindowImpl->mpFrameWindow )
{
bool bDecorated = false;
- vcl::Window *pChildFrame = pFrameWin->ImplGetWindow();
+ VclPtr< vcl::Window > pChildFrame = pFrameWin->ImplGetWindow();
// #i15285# unfortunately WB_MOVEABLE is the same as WB_TABSTOP which can
// be removed for ToolBoxes to influence the keyboard accessibility
// thus WB_MOVEABLE is no indicator for decoration anymore
// but FloatingWindows carry this information in their TitleType...
// TODO: avoid duplicate WinBits !!!
if( pChildFrame && pChildFrame->ImplIsFloatingWindow() )
- bDecorated = static_cast<FloatingWindow*>(pChildFrame)->GetTitleType() != FloatWinTitleType::NONE;
+ bDecorated = static_cast<FloatingWindow*>(pChildFrame.get())->GetTitleType() != FloatWinTitleType::NONE;
if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
{
@@ -3537,7 +3537,7 @@ void Window::EnableNativeWidget( bool bEnable )
}
// push down, useful for compound controls
- vcl::Window *pChild = mpWindowImpl->mpFirstChild;
+ VclPtr< vcl::Window > pChild = mpWindowImpl->mpFirstChild;
while( pChild )
{
pChild->EnableNativeWidget( bEnable );