diff options
Diffstat (limited to 'sfx2/source/appl/childwin.cxx')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 2a904ca2421c..e1f2ecd40809 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -160,7 +160,6 @@ SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId) : pParent(pParentWindow) , nType(nId) , eChildAlignment(SfxChildAlignment::NOALIGNMENT) - , pWindow(0L) { pImp = new SfxChildWindow_Impl; pImp->pFact = 0L; @@ -199,7 +198,7 @@ void SfxChildWindow::Destroy() SfxChildWindow::~SfxChildWindow() { delete pContext; - delete pWindow; + pWindow.disposeAndClear(); delete pImp; } @@ -336,16 +335,16 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const sal_uIntPtr nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( pWindow->GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); - aInfo.aWinState = static_cast<SystemWindow*>(pWindow)->GetWindowState( nMask ); + aInfo.aWinState = static_cast<SystemWindow*>(pWindow.get())->GetWindowState( nMask ); } else if ( pWindow->GetType() == RSC_DOCKINGWINDOW ) { - if (static_cast<DockingWindow*>(pWindow)->GetFloatingWindow() ) - aInfo.aWinState = static_cast<DockingWindow*>(pWindow)->GetFloatingWindow()->GetWindowState(); + if (static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow() ) + aInfo.aWinState = static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow()->GetWindowState(); else { SfxChildWinInfo aTmpInfo; - static_cast<SfxDockingWindow*>(pWindow)->FillInfo( aTmpInfo ); + static_cast<SfxDockingWindow*>(pWindow.get())->FillInfo( aTmpInfo ); aInfo.aExtraString = aTmpInfo.aExtraString; } } @@ -511,14 +510,13 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding } SfxChildWindowContext::SfxChildWindowContext( sal_uInt16 nId ) - : pWindow( NULL ) - , nContextId( nId ) + : nContextId( nId ) { } SfxChildWindowContext::~SfxChildWindowContext() { - delete pWindow; + pWindow.disposeAndClear(); } FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const @@ -654,10 +652,10 @@ void SfxChildWindow::Hide() switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - static_cast<DockingWindow*>(pWindow)->Hide(); + static_cast<DockingWindow*>(pWindow.get())->Hide(); break; case RSC_TOOLBOX : - static_cast<ToolBox*>(pWindow)->Hide(); + static_cast<ToolBox*>(pWindow.get())->Hide(); break; default: pWindow->Hide(); @@ -670,10 +668,10 @@ void SfxChildWindow::Show( sal_uInt16 nFlags ) switch ( pWindow->GetType() ) { case RSC_DOCKINGWINDOW : - static_cast<DockingWindow*>(pWindow)->Show( true, nFlags ); + static_cast<DockingWindow*>(pWindow.get())->Show( true, nFlags ); break; case RSC_TOOLBOX : - static_cast<ToolBox*>(pWindow)->Show( true, nFlags ); + static_cast<ToolBox*>(pWindow.get())->Show( true, nFlags ); break; default: pWindow->Show( true, nFlags ); |