diff options
Diffstat (limited to 'vcl/source/window/syswin.cxx')
-rw-r--r-- | vcl/source/window/syswin.cxx | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index c5d0522dc0e1..99ac9bcb4fa4 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -106,12 +106,21 @@ void SystemWindow::loadUI(vcl::Window* pParent, const OString& rID, const OUStri SystemWindow::~SystemWindow() { + disposeOnce(); +} + +void SystemWindow::dispose() +{ maLayoutIdle.Stop(); delete mpImplData; mpImplData = NULL; + // Hack to make sure code called from base ~Window does not interpret this // as a SystemWindow (which it no longer is by then): mpWindowImpl->mbSysWin = false; + disposeBuilder(); + mpDialogParent.clear(); + Window::dispose(); } bool SystemWindow::Notify( NotifyEvent& rNEvt ) @@ -177,6 +186,8 @@ bool SystemWindow::PreNotify( NotifyEvent& rNEvt ) TaskPaneList* SystemWindow::GetTaskPaneList() { + if( !mpImplData ) + return NULL; if( mpImplData->mpTaskPaneList ) return mpImplData->mpTaskPaneList ; else @@ -306,7 +317,7 @@ void SystemWindow::ShowTitleButton( sal_uInt16 nButton, bool bVisible ) { mbDockBtn = bVisible; if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetDockButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetDockButton( bVisible ); } } else if ( nButton == TITLE_BUTTON_HIDE ) @@ -315,13 +326,13 @@ void SystemWindow::ShowTitleButton( sal_uInt16 nButton, bool bVisible ) { mbHideBtn = bVisible; if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetHideButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetHideButton( bVisible ); } } else if ( nButton == TITLE_BUTTON_MENU ) { if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuButton( bVisible ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuButton( bVisible ); } else return; @@ -341,7 +352,7 @@ void SystemWindow::SetPin( bool bPin ) { mbPinned = bPin; if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetPin( bPin ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetPin( bPin ); } } @@ -356,7 +367,7 @@ void SystemWindow::RollUp() aSize.Width() = GetOutputSizePixel().Width(); mbRollUp = true; if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetRollUp( true, aSize ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetRollUp( true, aSize ); else SetOutputSizePixel( aSize ); mbRollFunc = false; @@ -369,7 +380,7 @@ void SystemWindow::RollDown() { mbRollUp = false; if ( mpWindowImpl->mpBorderWindow ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetRollUp( false, maOrgSize ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetRollUp( false, maOrgSize ); else SetOutputSizePixel( maOrgSize ); } @@ -380,7 +391,7 @@ void SystemWindow::SetMinOutputSizePixel( const Size& rSize ) maMinOutSize = rSize; if ( mpWindowImpl->mpBorderWindow ) { - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMinOutputSize( rSize.Width(), rSize.Height() ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMinOutputSize( rSize.Width(), rSize.Height() ); if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() ); } @@ -399,7 +410,7 @@ void SystemWindow::SetMaxOutputSizePixel( const Size& rSize ) mpImplData->maMaxOutSize = aSize; if ( mpWindowImpl->mpBorderWindow ) { - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMaxOutputSize( aSize.Width(), aSize.Height() ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMaxOutputSize( aSize.Width(), aSize.Height() ); if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame ) mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() ); } @@ -905,11 +916,11 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css:: if ( pMenuBar ) { DBG_ASSERT( !pMenuBar->pWindow, "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" ); - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( pNewWindow = MenuBar::ImplCreate( mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar, rFrame)); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( pNewWindow = MenuBar::ImplCreate( mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar, rFrame)); CallEventListeners( VCLEVENT_WINDOW_MENUBARADDED, (void*) pMenuBar ); } else - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarWindow( NULL ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( NULL ); ImplToBottomChild(); if ( pOldMenuBar ) { @@ -952,9 +963,9 @@ void SystemWindow::SetMenuBarMode( sal_uInt16 nMode ) if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) { if ( nMode == MENUBAR_MODE_HIDE ) - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarMode( true ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true ); else - static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow)->SetMenuBarMode( false ); + static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( false ); } } } |