Explicit disposeOnce instead of transient wrappers.
Change-Id: I578aa360c9923abd3fc516865896a004f377375b
audit: "vclwidget: check for calling delete on subclasses of vcl::Window"
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 5f1cfed..7715de0 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -816,7 +816,7 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
{
if ( !( pWindow_->GetStatus() & BASWIN_INRESCHEDULE ) )
{
VclPtr<BaseWindow>(pWindow_).disposeAndClear();
pWindow_->disposeOnce();
}
else
{
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index efa51d3..1683bdb 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -253,7 +253,7 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl)
EndDialog( RET_OK );
VclPtr<SearchProgress>(this).disposeAndClear();
disposeOnce();
return 0L;
}
@@ -431,7 +431,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl)
GetParent()->LeaveWait();
EndDialog( RET_OK );
VclPtr<TakeProgress>(this).disposeAndClear();
disposeOnce();
return 0L;
}
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index da52057..32242f1 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -264,9 +264,7 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete )
makeAny(_pConn->GetAccessible()),
Any());
if ( _bDelete )
{
VclPtr<OTableConnection>(_pConn).disposeAndClear();
}
_pConn->disposeOnce();
return true;
}
@@ -398,9 +396,9 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
m_pLastFocusTabWin = NULL;
pTabWin->clearListBox();
VclPtr<OTableWindow>(pTabWin).disposeAndClear();
pTabWin->disposeOnce();
}
if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed
modified();
}
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index e60cebf..374a2e4 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -926,7 +926,7 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// Initialisation failed
// (for example when the Connection to the database is not available at the moment)
pTabWin->clearListBox();
VclPtr<OQueryTableWindow>(pTabWin).disposeAndClear();
pTabWin->disposeOnce();
}
}
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 09ed6b2..4fedbfa 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1384,7 +1384,7 @@ void SfxPopupWindow::Delete()
{
if ( m_aDeleteLink.IsSet() )
m_aDeleteLink.Call( this );
VclPtr<SfxPopupWindow>(this).disposeAndClear();
disposeOnce();
}
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index 9809442..b3c1793 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -214,7 +214,7 @@ namespace svt
m_pHelp.disposeAndClear();
for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i)
VclPtr<vcl::Window>(GetPage(i)).disposeAndClear();
GetPage(i)->disposeOnce();
delete m_pImpl;
WizardDialog::dispose();
diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx
index 7bcd32b..82f61e3 100644
--- a/svtools/source/uno/popupwindowcontroller.cxx
+++ b/svtools/source/uno/popupwindowcontroller.cxx
@@ -126,7 +126,7 @@ IMPL_LINK( PopupWindowControllerImpl, WindowEventListener, VclSimpleEvent*, pEve
IMPL_STATIC_LINK( PopupWindowControllerImpl, AsyncDeleteWindowHdl, vcl::Window*, pWindow )
{
(void)*pThis;
VclPtr<vcl::Window>(pWindow).disposeAndClear();
pWindow->disposeOnce();
return 0;
}
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index a99333e..33363a0 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -411,8 +411,7 @@ IMPL_STATIC_LINK( SwSendMailDialog, RemoveThis, Timer*, pTimer )
(!pThis->m_pImpl->xMailDispatcher.is() ||
!pThis->m_pImpl->xMailDispatcher->isRunning()))
{
VclPtr<vcl::Window> a(pThis);
a.disposeAndClear();
pThis->disposeOnce();
}
else
{
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index fb057fc..f5f788f 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -859,8 +859,7 @@ void SwNavigationPI::dispose()
SfxImageManager* pImgMan = SfxImageManager::GetImageManager(*SW_MOD());
pImgMan->ReleaseToolBox(aContentToolBox.get());
pImgMan->ReleaseToolBox(aGlobalToolBox.get());
VclPtr<vcl::Window> a(aContentToolBox->GetItemWindow(FN_PAGENUMBER));
a.disposeAndClear();
aContentToolBox->GetItemWindow(FN_PAGENUMBER)->disposeOnce();
aContentToolBox->Clear();
if(pxObjectShell)
{
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 21532c3..e4097ed 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -3297,7 +3297,7 @@ void VclBuilder::delete_by_name(const OString& sID)
void VclBuilder::delete_by_window(vcl::Window *pWindow)
{
drop_ownership(pWindow);
VclPtr<vcl::Window>(pWindow).disposeAndClear();
pWindow->disposeOnce();
}
void VclBuilder::drop_ownership(const vcl::Window *pWindow)