diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 10:44:13 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 10:46:01 +0100 |
commit | c0a802b59e1edddeb0b621e15137f5058299efd7 (patch) | |
tree | 48203cffcd51d1d2747bb2384608907d73b69670 | |
parent | vclwidget: change all vcl::window fields to be wrapped in VclPtr (diff) | |
download | core-c0a802b59e1edddeb0b621e15137f5058299efd7.tar.gz core-c0a802b59e1edddeb0b621e15137f5058299efd7.zip |
Audit and correct misc. clears -> disposeAndClears.
Anything that used to be 'delete'd should be disposeAndCleared()
in the new world.
143 files changed, 332 insertions, 322 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 24defd8d3141..698e78bb373d 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -202,7 +202,7 @@ MediaControl::~MediaControl() void MediaControl::dispose() { maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL ); - mpZoomListBox.clear(); + mpZoomListBox.disposeAndClear(); maTimeEdit.disposeAndClear(); maZoomToolBox.disposeAndClear(); maVolumeSlider.disposeAndClear(); diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 4c08dcbb770e..4735f12e70e9 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -1414,10 +1414,8 @@ DialogWindowLayout::~DialogWindowLayout() void DialogWindowLayout::dispose() { if (pPropertyBrowser) - { Remove(pPropertyBrowser); - } - pPropertyBrowser.clear(); + pPropertyBrowser.disposeAndClear(); pChild.clear(); Layout::dispose(); } diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx index 44436109dddd..0da5875bb645 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx @@ -60,7 +60,7 @@ ChartTypeDialog::~ChartTypeDialog() void ChartTypeDialog::dispose() { - m_pChartTypeTabPage.clear(); + m_pChartTypeTabPage.disposeAndClear(); ModalDialog::dispose(); } diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index 66af10a37ccb..5c8bc2b0c722 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -54,7 +54,7 @@ CreationWizardUnoDlg::CreationWizardUnoDlg( const uno::Reference< uno::XComponen CreationWizardUnoDlg::~CreationWizardUnoDlg() { SolarMutexGuard aSolarGuard; - m_pDialog.clear(); + m_pDialog.disposeAndClear(); } // lang::XServiceInfo OUString SAL_CALL CreationWizardUnoDlg::getImplementationName() @@ -268,7 +268,7 @@ void SAL_CALL CreationWizardUnoDlg::disposing() m_xParentWindow.clear(); SolarMutexGuard aSolarGuard; - m_pDialog.clear(); + m_pDialog.disposeAndClear(); try { diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx index 09e55375e734..cdd34e1aa5a2 100644 --- a/chart2/source/controller/dialogs/dlg_DataSource.cxx +++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx @@ -164,13 +164,11 @@ DataSourceDialog::~DataSourceDialog() void DataSourceDialog::dispose() { + m_pRangeChooserTabePage.disposeAndClear(); + m_pDataSourceTabPage.disposeAndClear(); if (m_pTabControl) - { m_nLastPageId = m_pTabControl->GetCurPageId(); - } - m_pRangeChooserTabePage.clear(); - m_pDataSourceTabPage.clear(); - m_pTabControl.clear(); + m_pTabControl.disposeAndClear(); m_pBtnOK.clear(); TabDialog::dispose(); } diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx index bb28a878bbb3..b3e97fb69f74 100644 --- a/chart2/source/controller/dialogs/dlg_View3D.cxx +++ b/chart2/source/controller/dialogs/dlg_View3D.cxx @@ -71,11 +71,11 @@ View3DDialog::~View3DDialog() void View3DDialog::dispose() { + m_pGeometry.disposeAndClear(); + m_pAppearance.disposeAndClear(); + m_pIllumination.disposeAndClear(); if (m_pTabControl) m_nLastPageId = m_pTabControl->GetCurPageId(); - m_pGeometry.clear(); - m_pAppearance.clear(); - m_pIllumination.clear(); m_pTabControl.clear(); TabDialog::dispose(); } diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index d5275e1a0808..ff544bda43b8 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -83,7 +83,7 @@ void ChartWindow::dispose() x3DWindowProvider->setWindow(0); x3DWindowProvider->update(); } - m_pOpenGLWindow.clear(); + m_pOpenGLWindow.disposeAndClear(); vcl::Window::dispose(); } diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 7bc162e4c3f8..6d5d3a9c5ef3 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -114,13 +114,15 @@ void SvxHyperlinkTabPageBase::dispose() { maTimer.Stop(); + mpMarkWnd.disposeAndClear(); + mpCbbFrame.clear(); mpLbForm.clear(); mpEdIndication.clear(); mpEdText.clear(); mpBtScript.clear(); mpDialog.clear(); - mpMarkWnd.clear(); + IconChoicePage::dispose(); } diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index 9cbbef5f2160..72979c4464f6 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -239,7 +239,7 @@ void SvxMultiPathDialog::dispose() } } - m_pRadioLB.clear(); + m_pRadioLB.disposeAndClear(); m_pAddBtn.clear(); m_pDelBtn.clear(); ModalDialog::dispose(); diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 55b85df456fa..d8137095b829 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -156,8 +156,8 @@ void CertPathDialog::dispose() delete pCertPath; pEntry = m_pCertPathList->Next( pEntry ); } + m_pCertPathList.disposeAndClear(); m_pCertPathListContainer.clear(); - m_pCertPathList.clear(); m_pAddBtn.clear(); m_pOKBtn.clear(); ModalDialog::dispose(); diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index f149629776b8..d9822ac51f10 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -170,7 +170,7 @@ void DbRegistrationOptionsPage::dispose() { for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i ) delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() ); - pPathBox.clear(); + pPathBox.disposeAndClear(); m_pPathCtrl.clear(); m_pNew.clear(); m_pEdit.clear(); diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 6dfd19f52a2a..a19a8898e124 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -147,7 +147,7 @@ void SvxFontSubstTabPage::dispose() pCheckButtonData = NULL; delete pConfig; pConfig = NULL; - m_pCheckLB.clear(); + m_pCheckLB.disposeAndClear(); m_pUseTableCB.clear(); m_pReplacements.clear(); m_pFont1CB.clear(); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 6bdf8a1340e7..08d7d9059b61 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -302,6 +302,8 @@ ColorConfigWindow_Impl::Chapter::Chapter(vcl::Window *pGrid, ColorConfigWindow_Impl::Chapter::~Chapter() { + // FIXME: we had an horrible m_bOwnsWidget const + m_pText.disposeAndClear(); } void ColorConfigWindow_Impl::Chapter::Show(Wallpaper const& rBackWall) @@ -368,9 +370,9 @@ ColorConfigWindow_Impl::Entry::~Entry() { if (m_bOwnsWidgets) { - m_pText.clear(); - m_pColorList.clear(); - m_pPreview.clear(); + m_pText.disposeAndClear(); + m_pColorList.disposeAndClear(); + m_pPreview.disposeAndClear(); } } @@ -508,9 +510,9 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(vcl::Window* pParent) void ColorConfigWindow_Impl::dispose() { disposeBuilder(); - m_pGrid.clear(); - m_pVScroll.clear(); - m_pHeaderHB.clear(); + m_pGrid.clear(); + m_pVScroll.clear(); + m_pHeaderHB.clear(); VclContainer::dispose(); } @@ -918,10 +920,10 @@ ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl() void ColorConfigCtrl_Impl::dispose() { - m_pVScroll.clear(); - m_pScrollWindow.clear(); - m_pBody.clear(); - m_pHeaderHB.clear(); + m_pVScroll.disposeAndClear(); + m_pScrollWindow.disposeAndClear(); + m_pBody.disposeAndClear(); + m_pHeaderHB.disposeAndClear(); VclVBox::dispose(); } diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 5dc7a284e51f..490b41c2ae4b 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -222,6 +222,7 @@ SvxProxyTabPage::~SvxProxyTabPage() void SvxProxyTabPage::dispose() { + mpCertPathDlg.disposeAndClear(); m_pProxyModeLB.clear(); m_pHttpProxyFT.clear(); m_pHttpProxyED.clear(); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 98853d58b743..7cd9977e3913 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -207,7 +207,9 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage() void SvxJavaOptionsPage::dispose() { - m_pJavaList.clear(); + m_pJavaList.disposeAndClear(); + m_pParamDlg.disposeAndClear(); + m_pPathDlg.disposeAndClear(); ClearJavaInfo(); #if HAVE_FEATURE_JAVA std::vector< JavaInfo* >::iterator pIter; @@ -229,8 +231,6 @@ void SvxJavaOptionsPage::dispose() m_pExpertConfigBtn.clear(); m_pExperimentalCB.clear(); m_pMacroCB.clear(); - m_pParamDlg.clear(); - m_pPathDlg.clear(); SfxTabPage::dispose(); } diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 7d2d48c9baca..39e94a02efe5 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -256,7 +256,7 @@ void SvxPathTabPage::dispose() { for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i ) delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData()); - pPathBox.clear(); + pPathBox.disposeAndClear(); } delete pImpl; pImpl = NULL; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index f37c797d3f66..e45cbc823974 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -575,6 +575,7 @@ void OfaTreeOptionsDialog::dispose() SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) ); SetViewOptUserItem( aTabPageOpt, aPageData ); } + pPageInfo->m_pPage.disposeAndClear(); } if (pPageInfo->m_nPageId == RID_SFXPAGE_LINGU) @@ -587,6 +588,8 @@ void OfaTreeOptionsDialog::dispose() } } + pPageInfo->m_pExtPage.disposeAndClear(); + delete pPageInfo; } pEntry = pTreeLB->Next(pEntry); @@ -600,7 +603,7 @@ void OfaTreeOptionsDialog::dispose() { OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData()); if ( pGroupInfo ) - pGroupInfo->m_pExtPage.clear(); + pGroupInfo->m_pExtPage.disposeAndClear(); delete pGroupInfo; } pEntry = pTreeLB->Next(pEntry); diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx index 16fcd75a6de6..d114fe9eace5 100644 --- a/cui/source/options/webconninfo.cxx +++ b/cui/source/options/webconninfo.cxx @@ -147,7 +147,7 @@ WebConnectionInfoDialog::~WebConnectionInfoDialog() void WebConnectionInfoDialog::dispose() { - m_pPasswordsLB.clear(); + m_pPasswordsLB.disposeAndClear(); m_pRemoveBtn.clear(); m_pRemoveAllBtn.clear(); m_pChangeBtn.clear(); diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 83a436aa63e3..92ee3e21ef95 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -122,10 +122,10 @@ UnoDataBrowserView::~UnoDataBrowserView() void UnoDataBrowserView::dispose() { - m_pSplitter.clear(); + m_pSplitter.disposeAndClear(); setTreeView(NULL); - m_pStatus.clear(); + m_pStatus.disposeAndClear(); try { diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 73495b56dcab..9de7ee291de9 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -83,8 +83,8 @@ namespace --_nPos; _pControl->Hide(); _pControlText->Hide(); - _pControl.clear(); - _pControlText.clear(); + _pControl.disposeAndClear(); + _pControlText.disposeAndClear(); } } @@ -1049,7 +1049,7 @@ void OFieldDescControl::DeactivateAggregate( EControlType eType ) if ( pFormatSample ) { pFormatSample->Hide(); - pFormatSample.clear(); + pFormatSample.disposeAndClear(); } break; case tpBoolDefault: diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 6f86962649c1..77ac1b685c39 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -82,8 +82,8 @@ void OTableGrantControl::dispose() m_nDeactivateEvent = 0; } - m_pCheckCell.clear(); - m_pEdit.clear(); + m_pCheckCell.disposeAndClear(); + m_pEdit.disposeAndClear(); m_xTables = NULL; ::svt::EditBrowseBox::dispose(); diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index e30ab1314b3c..4fd8c0236e91 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -46,7 +46,7 @@ OConnectionURLEdit::~OConnectionURLEdit() void OConnectionURLEdit::dispose() { SetSubEdit(nullptr); - m_pForcedPrefix.clear(); + m_pForcedPrefix.disposeAndClear(); Edit::dispose(); } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index c50eef04c453..2f2e8f385ae8 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -114,10 +114,11 @@ namespace dbaui void OConnectionHelper::dispose() { - m_pFT_Connection.clear(); - m_pConnectionURL.clear(); - m_pPB_Connection.clear(); - m_pPB_CreateDB.clear(); + // FIXME: used to have an if (m_bDelete) ... + m_pFT_Connection.disposeAndClear(); + m_pConnectionURL.disposeAndClear(); + m_pPB_Connection.disposeAndClear(); + m_pPB_CreateDB.disposeAndClear(); OGenericAdministrationPage::dispose(); } diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index a6aa0ab1b925..36d39547f117 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -115,8 +115,8 @@ namespace dbaui void IndexFieldsControl::dispose() { - m_pSortingCell.clear(); - m_pFieldNameCell.clear(); + m_pSortingCell.disposeAndClear(); + m_pFieldNameCell.disposeAndClear(); ::svt::EditBrowseBox::dispose(); } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 887a1d06ba4e..68b5b59a391c 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -710,11 +710,11 @@ void OCopyTableWizard::dispose() m_aTypeInfo.clear(); m_aDestTypeInfoIndex.clear(); - m_pbHelp.clear(); - m_pbCancel.clear(); - m_pbPrev.clear(); - m_pbNext.clear(); - m_pbFinish.clear(); + m_pbHelp.disposeAndClear(); + m_pbCancel.disposeAndClear(); + m_pbPrev.disposeAndClear(); + m_pbNext.disposeAndClear(); + m_pbFinish.disposeAndClear(); WizardDialog::dispose(); } diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 0eb7d8f2ae4d..bcc5386136bf 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -45,7 +45,6 @@ using namespace ::com::sun::star::sdbc; OWizTypeSelectControl::OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* pParentTabPage, OTableDesignHelpBar* pHelpBar) : OFieldDescControl(pParent, pHelpBar) { - m_pParentTabPage = pParentTabPage; } diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index de5b30488a57..d9c0734c8483 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -66,8 +66,8 @@ OJoinDesignView::~OJoinDesignView() void OJoinDesignView::dispose() { - m_pScrollWindow.clear(); - m_pTableView.clear(); + m_pScrollWindow.disposeAndClear(); + m_pTableView.disposeAndClear(); ODataView::dispose(); } diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index ad15132b72ef..70adb519d022 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -96,7 +96,7 @@ void OScrollWindowHelper::dispose() { m_aHScrollBar.disposeAndClear(); m_aVScrollBar.disposeAndClear(); - m_pCornerWindow.clear(); + m_pCornerWindow.disposeAndClear(); m_pTableView.clear(); vcl::Window::dispose(); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 87ea89bda2a0..368f5c4738fb 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -158,12 +158,12 @@ OSelectionBrowseBox::~OSelectionBrowseBox() void OSelectionBrowseBox::dispose() { - m_pTextCell.clear(); - m_pVisibleCell.clear(); - m_pFieldCell.clear(); - m_pTableCell.clear(); - m_pOrderCell.clear(); - m_pFunctionCell.clear(); + m_pTextCell.disposeAndClear(); + m_pVisibleCell.disposeAndClear(); + m_pFieldCell.disposeAndClear(); + m_pTableCell.disposeAndClear(); + m_pOrderCell.disposeAndClear(); + m_pFunctionCell.disposeAndClear(); ::svt::EditBrowseBox::dispose(); } diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index 71c037c80e80..e9c63e0f4de7 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -139,7 +139,7 @@ throw (uno::RuntimeException, std::exception) svt::ToolboxController::dispose(); SolarMutexGuard aSolarMutexGuard; - m_pLimitBox.clear(); + m_pLimitBox.disposeAndClear(); } /// XStatusListener diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 3face44e3790..a02b527573c5 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -274,10 +274,10 @@ void OTableEditorCtrl::dispose() Application::RemoveUserEvent( nInvalidateTypeEvent ); // Delete the control types - pNameCell.clear(); - pTypeCell.clear(); - pDescrCell.clear(); - pHelpTextCell.clear(); + pNameCell.disposeAndClear(); + pTypeCell.disposeAndClear(); + pDescrCell.disposeAndClear(); + pHelpTextCell.disposeAndClear(); pDescrWin.clear(); OTableRowView::dispose(); } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 403bd89ba61d..e450383be3ea 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -208,9 +208,9 @@ ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl() void ExtBoxWithBtns_Impl::dispose() { - m_pOptionsBtn.clear(); - m_pEnableBtn.clear(); - m_pRemoveBtn.clear(); + m_pOptionsBtn.disposeAndClear(); + m_pEnableBtn.disposeAndClear(); + m_pRemoveBtn.disposeAndClear(); m_pParent.clear(); ExtensionBox_Impl::dispose(); } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 07a7d067f2d1..0432d5d14867 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -253,13 +253,13 @@ void ExtensionBox_Impl::dispose() for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex ) { - (*iIndex)->m_pPublisher.clear(); + (*iIndex)->m_pPublisher.disposeAndClear(); (*iIndex)->m_xPackage->removeEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) ); } m_vEntries.clear(); - m_pScrollBar.clear(); + m_pScrollBar.disposeAndClear(); m_xRemoveListener.clear(); @@ -435,7 +435,7 @@ void ExtensionBox_Impl::DeleteRemoved() for ( ITER iIndex = m_vRemovedEntries.begin(); iIndex < m_vRemovedEntries.end(); ++iIndex ) { - (*iIndex)->m_pPublisher.clear(); + (*iIndex)->m_pPublisher.disposeAndClear(); } m_vRemovedEntries.clear(); diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 07168b74a4fd..a031b476ac97 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -169,7 +169,7 @@ sal_Int16 TheExtensionManager::execute() if ( m_pUpdReqDialog ) { nRet = m_pUpdReqDialog->Execute(); - m_pUpdReqDialog.clear(); + m_pUpdReqDialog.disposeAndClear(); } return nRet; @@ -256,8 +256,8 @@ void TheExtensionManager::terminateDialog() if ( ! dp_misc::office_is_running() ) { const SolarMutexGuard guard; - m_pExtMgrDialog.clear(); - m_pUpdReqDialog.clear(); + m_pExtMgrDialog.disposeAndClear(); + m_pUpdReqDialog.disposeAndClear(); Application::Quit(); } } @@ -421,8 +421,8 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt ) if ( dp_misc::office_is_running() ) { const SolarMutexGuard guard; - m_pExtMgrDialog.clear(); - m_pUpdReqDialog.clear(); + m_pExtMgrDialog.disposeAndClear(); + m_pUpdReqDialog.disposeAndClear(); } s_ExtMgr.clear(); } diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index e7a677080acb..01af7a6dd309 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -579,11 +579,11 @@ void UpdateDialog::dispose() { delete (*i); } + m_pUpdates.disposeAndClear(); m_pchecking.clear(); m_pthrobber.clear(); m_pUpdate.clear(); m_pContainer.clear(); - m_pUpdates.clear(); m_pAll.clear(); m_pDescription.clear(); m_pPublisherLabel.clear(); diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 0174189c2cb4..87abe11e61f2 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -217,17 +217,10 @@ namespace bib if ( pToolBar ) { pDatMan->SetToolbar(0); + pToolBar.disposeAndClear(); } - if( pGridWin ) - { - BibGridwin* pDel = pGridWin; - pGridWin.clear(); - pDel->disposeGridWin(); - delete pDel; - } - pToolBar.clear(); - pGridWin.clear(); + pGridWin.disposeAndClear(); BibSplitWindow::dispose(); } diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index b6e65e1665d8..34af38efa5b0 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -181,7 +181,7 @@ void BibBookContainer::createTopFrame( BibShortCutHandler* pWin ) if(pTopWin) { RemoveItem(TOP_WINDOW); - pTopWin.clear(); + pTopWin.disposeAndClear(); } pTopWin=new BibWindowContainer(this,pWin); pTopWin->Show(); @@ -198,7 +198,7 @@ void BibBookContainer::createBottomFrame( BibShortCutHandler* pWin ) if(pBottomWin) { RemoveItem(BOTTOM_WINDOW); - pBottomWin.clear(); + pBottomWin.disposeAndClear(); } pBottomWin=new BibWindowContainer(this,pWin); diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 3de62a17848f..ccc5b54a9642 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -448,7 +448,7 @@ namespace pcr if ( rpButton ) { rpButton->Hide(); - rpButton.clear(); + rpButton.disposeAndClear(); } if ( _bReLayout ) diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index 11e6f7171597..9ff555c8ea0b 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -266,7 +266,7 @@ void SAL_CALL XMLFilterDialogComponent::disposing() { ::SolarMutexGuard aGuard; - mpDialog.clear(); + mpDialog.disposeAndClear(); if (pXSLTResMgr) { diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 5e88100b2823..a6761a5c9822 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1421,9 +1421,9 @@ SvxPathControl::~SvxPathControl() void SvxPathControl::dispose() { - m_pVBox.clear(); - m_pFocusCtrl.clear(); - m_pHeaderBar.clear(); + m_pFocusCtrl.disposeAndClear(); + m_pHeaderBar.disposeAndClear(); + m_pVBox.disposeAndClear(); vcl::Window::dispose(); } diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index ea5a5022a738..2b351e297dca 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -80,8 +80,8 @@ XMLFilterTabDialog::~XMLFilterTabDialog() void XMLFilterTabDialog::dispose() { - mpBasicPage.clear(); - mpXSLTPage.clear(); + mpBasicPage.disposeAndClear(); + mpXSLTPage.disposeAndClear(); delete mpNewInfo; m_pTabCtrl.clear(); m_pOKBtn.clear(); diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx index ef2ccb5f38e1..b292f642dfe0 100644 --- a/forms/source/richtext/richtextimplcontrol.cxx +++ b/forms/source/richtext/richtextimplcontrol.cxx @@ -91,10 +91,10 @@ namespace frm m_pEngine->RemoveView( m_pView ); m_pEngine->revokeEngineStatusListener( this ); delete m_pView; - m_pViewport.clear(); - m_pHScroll.clear(); - m_pVScroll.clear(); - m_pScrollCorner.clear(); + m_pViewport.disposeAndClear(); + m_pHScroll.disposeAndClear(); + m_pVScroll.disposeAndClear(); + m_pScrollCorner.disposeAndClear(); } @@ -344,7 +344,7 @@ namespace frm // create or delete the scrollbars, as necessary if ( !bNeedVScroll ) { - m_pVScroll.clear(); + m_pVScroll.disposeAndClear(); } else { @@ -355,7 +355,7 @@ namespace frm if ( !bNeedHScroll ) { - m_pHScroll.clear(); + m_pHScroll.disposeAndClear(); } else { @@ -366,13 +366,13 @@ namespace frm if ( m_pHScroll && m_pVScroll ) { - m_pScrollCorner.clear(); + m_pScrollCorner.disposeAndClear(); m_pScrollCorner = new ScrollBarBox( m_pAntiImpl ); m_pScrollCorner->Show(); } else { - m_pScrollCorner.clear(); + m_pScrollCorner.disposeAndClear(); } layoutWindow(); diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 73afd345a1df..5e2f38825752 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -364,9 +364,9 @@ FormulaDlg_Impl::~FormulaDlg_Impl() m_pTabCtrl->RemovePage(TP_FUNCTION); m_pTabCtrl->RemovePage(TP_STRUCT); - pStructPage.clear(); - pFuncPage.clear(); - pParaWin.clear(); + pStructPage.disposeAndClear(); + pFuncPage.disposeAndClear(); + pParaWin.disposeAndClear(); DeleteArgs(); } diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx index eef7e27a6be8..e6099522efcf 100644 --- a/fpicker/source/office/PlacesListBox.cxx +++ b/fpicker/source/office/PlacesListBox.cxx @@ -48,7 +48,7 @@ PlacesListBox_Impl::~PlacesListBox_Impl( ) void PlacesListBox_Impl::dispose() { - mpHeaderBar.clear(); + mpHeaderBar.disposeAndClear(); mpParent.clear(); SvHeaderTabListBox::dispose(); } @@ -93,9 +93,9 @@ PlacesListBox::~PlacesListBox( ) void PlacesListBox::dispose() { - mpImpl.clear(); - mpAddBtn.clear(); - mpDelBtn.clear(); + mpImpl.disposeAndClear(); + mpAddBtn.disposeAndClear(); + mpDelBtn.disposeAndClear(); mpDlg.clear(); Control::dispose(); } diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx index 8243d5159223..95ee24b14db8 100644 --- a/fpicker/source/office/commonpicker.cxx +++ b/fpicker/source/office/commonpicker.cxx @@ -123,7 +123,7 @@ namespace svt m_pDlg->EndDialog( RET_CANCEL ); } - m_pDlg.clear(); + m_pDlg.disposeAndClear(); m_xWindow = NULL; m_xDialogParent = NULL; } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 5d93cb1087d5..6c275e7b4010 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -449,10 +449,10 @@ void SvtFileDialog::dispose() } delete _pImp; - _pFileView.clear(); - _pSplitter.clear(); - _pContainer.clear(); - _pPrevBmp.clear(); + _pFileView.disposeAndClear(); + _pSplitter.disposeAndClear(); + _pContainer.disposeAndClear(); + _pPrevBmp.disposeAndClear(); _pCbReadOnly.clear(); _pCbLinkBox.clear(); _pCbPreviewBox.clear(); diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index c06d1bf693ff..4a99899cb292 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -251,10 +251,10 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) : SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl() { - _pBtnUp.clear(); + _pBtnUp.disposeAndClear(); delete _pUserFilter; delete _pFilter; - _pPlaces.clear(); + _pPlaces.disposeAndClear(); } diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx index 35d1779f002c..b0414824ed57 100644 --- a/framework/inc/classes/fwktabwindow.hxx +++ b/framework/inc/classes/fwktabwindow.hxx @@ -87,6 +87,7 @@ struct TabEntry TabEntry( sal_Int32 nIndex, const OUString& sURL, const css::uno::Reference< css::awt::XContainerWindowEventHandler > & rEventHdl ) : m_nIndex( nIndex ), m_pPage( NULL ), m_sPageURL( sURL ), m_xEventHdl( rEventHdl ) {} + ~TabEntry() { m_pPage.disposeAndClear(); } }; typedef std::vector< TabEntry* > TabEntryList; diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx index 9d3f1511ccb3..963decbb18cd 100644 --- a/framework/source/helper/vclstatusindicator.cxx +++ b/framework/source/helper/vclstatusindicator.cxx @@ -91,7 +91,7 @@ void SAL_CALL VCLStatusIndicator::end() m_pStatusBar->EndProgressMode(); m_pStatusBar->Show(false); - m_pStatusBar.clear(); + m_pStatusBar.disposeAndClear(); } } diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index bd4b368e9d43..84c8fcddb356 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -171,7 +171,7 @@ throw ( RuntimeException, std::exception ) SolarMutexGuard aSolarMutexGuard; m_pToolbar->SetItemWindow( m_nID, 0 ); - m_pComboBox.clear(); + m_pComboBox.disposeAndClear(); ComplexToolbarController::dispose(); } diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 5573c62ef8b4..12e8dffc3f92 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -155,7 +155,7 @@ throw ( RuntimeException, std::exception ) SolarMutexGuard aSolarMutexGuard; m_pToolbar->SetItemWindow( m_nID, 0 ); - m_pListBoxControl.clear(); + m_pListBoxControl.disposeAndClear(); ComplexToolbarController::dispose(); } diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx index 56e9921f8557..a75aaa3f3956 100644 --- a/framework/source/uielement/edittoolbarcontroller.cxx +++ b/framework/source/uielement/edittoolbarcontroller.cxx @@ -152,7 +152,7 @@ throw ( RuntimeException, std::exception ) SolarMutexGuard aSolarMutexGuard; m_pToolbar->SetItemWindow( m_nID, 0 ); - m_pEditControl.clear(); + m_pEditControl.disposeAndClear(); ComplexToolbarController::dispose(); } diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx index 3a7de070d5f2..629e254ebaa0 100644 --- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx +++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx @@ -213,7 +213,7 @@ throw ( RuntimeException, std::exception ) SolarMutexGuard aSolarMutexGuard; m_pToolbar->SetItemWindow( m_nID, 0 ); - m_pSpinfieldControl.clear(); + m_pSpinfieldControl.disposeAndClear(); ComplexToolbarController::dispose(); } diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index b8ba5fb20bfc..f6bfb7eaf03e 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -214,7 +214,7 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException, std::exc delete pUserData; } - m_pStatusBar.clear(); + m_pStatusBar.disposeAndClear(); if ( m_bFrameActionRegistered && m_xFrame.is() ) { diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index 469c7e4851b0..359dac655edd 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -522,8 +522,8 @@ public: m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl)); m_pDisclosureButton->Show(); } - virtual ~VclExpander() { dispose(); } - void dispose() SAL_OVERRIDE { m_pDisclosureButton.clear(); VclBin::dispose(); } + virtual ~VclExpander() { disposeOnce(); } + virtual void dispose() SAL_OVERRIDE { m_pDisclosureButton.disposeAndClear(); VclBin::dispose(); } virtual vcl::Window *get_child() SAL_OVERRIDE; virtual const vcl::Window *get_child() const SAL_OVERRIDE; virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE; diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index 2da233a22696..bc60825e71ab 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -330,7 +330,7 @@ void Condition::dispose() m_pMoveDown.clear(); m_pAddCondition.clear(); m_pRemoveCondition.clear(); - m_pColorFloat.clear(); + m_pColorFloat.disposeAndClear(); VclHBox::dispose(); } diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index adbe69d7ad23..2b51436d9ca6 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -230,7 +230,7 @@ void OFieldExpressionControl::dispose() if( m_nDeleteEvent ) Application::RemoveUserEvent( m_nDeleteEvent ); - m_pComboCell.clear(); + m_pComboCell.disposeAndClear(); m_pParent.clear(); ::svt::EditBrowseBox::dispose(); } @@ -1028,7 +1028,7 @@ void OGroupsSortingDialog::dispose() m_pGroupIntervalEd.clear(); m_pKeepTogetherLst.clear(); m_pHelpWindow.clear(); - m_pFieldExpression.clear(); + m_pFieldExpression.disposeAndClear(); FloatingWindow::dispose(); } diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 958e194831a4..44f6969e0c2e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -80,7 +80,7 @@ public: \ Class::~Class() \ { \ } \ -short Class::Execute() \ +short Class::Execute() \ { \ return pDlg->Execute(); \ } diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 2669dd5ddf66..de5749adac73 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -142,7 +142,7 @@ void ScCondFormatManagerDlg::dispose() m_pBtnAdd.clear(); m_pBtnRemove.clear(); m_pBtnEdit.clear(); - m_pCtrlManager.clear(); + m_pCtrlManager.disposeAndClear(); ModalDialog::dispose(); } diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 984f19307213..218f3258110f 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -46,7 +46,7 @@ SearchResultsDlg::~SearchResultsDlg() void SearchResultsDlg::dispose() { - mpList.clear(); + mpList.disposeAndClear(); ModelessDialog::dispose(); } diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 2b5d035276c1..7c0b4f3c8f92 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -168,7 +168,7 @@ void ScAcceptChgDlg::dispose() pChanges->SetModifiedLink(aLink); } - m_pAcceptChgCtr.clear(); + m_pAcceptChgCtr.disposeAndClear(); pTPFilter.clear(); pTPView.clear(); pTheView.clear(); diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 05a194f808ab..abe3d1df74e4 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -75,7 +75,7 @@ ScHighlightChgDlg::~ScHighlightChgDlg() void ScHighlightChgDlg::dispose() { SetDispatcherLock( false ); - m_pFilterCtr.clear(); + m_pFilterCtr.disposeAndClear(); m_pHighlightBox.clear(); m_pCbAccept.clear(); m_pCbReject.clear(); diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 5b04a227cdf8..4a2fd3ab248c 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -113,7 +113,7 @@ ScShareDocumentDlg::~ScShareDocumentDlg() void ScShareDocumentDlg::dispose() { - m_pLbUsers.clear(); + m_pLbUsers.disposeAndClear(); m_pCbShare.clear(); m_pFtWarning.clear(); ModalDialog::dispose(); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index 33e4cbd79a57..71a3e38dbf5b 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -107,7 +107,7 @@ ScNameDlg::~ScNameDlg() void ScNameDlg::dispose() { - m_pRangeManagerTable.clear(); + m_pRangeManagerTable.disposeAndClear(); m_pEdName.clear(); m_pEdAssign.clear(); m_pRbAssign.clear(); diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx index daf2b8e1d60e..13cef6ac18b9 100644 --- a/sc/source/ui/namedlg/namepast.cxx +++ b/sc/source/ui/namedlg/namepast.cxx @@ -70,10 +70,10 @@ ScNamePasteDlg::~ScNamePasteDlg() void ScNamePasteDlg::dispose() { + mpTable.disposeAndClear(); m_pBtnPasteAll.clear(); m_pBtnPaste.clear(); m_pBtnClose.clear(); - mpTable.clear(); ModalDialog::dispose(); } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index d94b6f506c23..3ec7b481b88b 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -196,10 +196,10 @@ ScPreviewShell::~ScPreviewShell() EndListening(*pDocShell); SetWindow(0); - pPreview.clear(); - pHorScroll.clear(); - pVerScroll.clear(); - pCorner.clear(); + pPreview.disposeAndClear(); + pHorScroll.disposeAndClear(); + pVerScroll.disposeAndClear(); + pCorner.disposeAndClear(); // normal mode of operation is switching back to default view in the same frame, // so there's no need to activate any other window here anymore diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index fd6a6c62f454..e651d9afa4b8 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -190,9 +190,9 @@ ScTabView::~ScTabView() delete pRowOutline[i]; } - pHSplitter.clear(); - pVSplitter.clear(); - pTabControl.clear(); + pHSplitter.disposeAndClear(); + pVSplitter.disposeAndClear(); + pTabControl.disposeAndClear(); } void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode ) diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index ce65a000ebcd..b493eca77b42 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -159,7 +159,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId ) PresetPropertyBox::~PresetPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } Any PresetPropertyBox::getValue() @@ -219,7 +219,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent ColorPropertyBox::~ColorPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } void ColorPropertyBox::setValue( const Any& rValue, const OUString& ) @@ -303,7 +303,7 @@ void FontPropertyBox::setValue( const Any& rValue, const OUString& ) FontPropertyBox::~FontPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } Any FontPropertyBox::getValue() @@ -357,7 +357,7 @@ DropdownMenuBox::~DropdownMenuBox() void DropdownMenuBox::dispose() { SetSubEdit(nullptr); - mpDropdownButton.clear(); + mpDropdownButton.disposeAndClear(); delete mpMenu; mpSubControl.disposeAndClear(); Edit::dispose(); @@ -437,7 +437,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo CharHeightPropertyBox::~CharHeightPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb ) @@ -528,7 +528,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W TransparencyPropertyBox::~TransparencyPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } void TransparencyPropertyBox::updateMenu() @@ -626,7 +626,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p RotationPropertyBox::~RotationPropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } void RotationPropertyBox::updateMenu() @@ -751,7 +751,7 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent ScalePropertyBox::~ScalePropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } void ScalePropertyBox::updateMenu() @@ -911,7 +911,7 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window* FontStylePropertyBox::~FontStylePropertyBox() { - mpControl.clear(); + mpControl.disposeAndClear(); } void FontStylePropertyBox::update() @@ -2212,9 +2212,9 @@ CustomAnimationDialog::~CustomAnimationDialog() void CustomAnimationDialog::dispose() { - mpEffectTabPage.clear(); - mpDurationTabPage.clear(); - mpTextAnimTabPage.clear(); + mpEffectTabPage.disposeAndClear(); + mpDurationTabPage.disposeAndClear(); + mpTextAnimTabPage.disposeAndClear(); delete mpSet; delete mpResultSet; diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index c7bba27e3eab..e6fb2655a1b4 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -224,7 +224,7 @@ void AnimationWindow::dispose() // delete the clones delete pMyDoc; - m_pCtlDisplay.clear(); + m_pCtlDisplay.disposeAndClear(); m_pBtnFirst.clear(); m_pBtnReverse.clear(); m_pBtnStop.clear(); diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx index bd6cad52decf..fa6b4e1e17eb 100644 --- a/sd/source/ui/dlg/brkdlg.cxx +++ b/sd/source/ui/dlg/brkdlg.cxx @@ -72,6 +72,8 @@ BreakDlg::~BreakDlg() void BreakDlg::dispose() { + mpProgress.disposeAndClear(); + pProgrInfo.disposeAndClear(); m_pFiObjInfo.clear(); m_pFiActInfo.clear(); m_pFiInsInfo.clear(); diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index f2ea08902841..f82e75fc230e 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -246,8 +246,8 @@ HeaderFooterDialog::~HeaderFooterDialog() void HeaderFooterDialog::dispose() { - mpSlideTabPage.clear(); - mpNotesHandoutsTabPage.clear(); + mpSlideTabPage.disposeAndClear(); + mpNotesHandoutsTabPage.disposeAndClear(); mpTabCtrl.clear(); maPBApplyToAll.clear(); maPBApply.clear(); diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index ba1a0131734c..7ef05ccc4f5b 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -103,7 +103,7 @@ FullScreenPane::~FullScreenPane (void) throw() void SAL_CALL FullScreenPane::disposing (void) { - mpWindow.clear(); + mpWindow.disposeAndClear(); if (mpWorkWindow.get() != NULL) { diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 15b2bb3eecbb..3f87111ca978 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -705,13 +705,12 @@ void SAL_CALL SlideshowImpl::disposing() } if( mpTimeButton ) - { mpTimeButton->Hide(); - mpTimeButton.clear(); - } + mpTimeButton.disposeAndClear(); if( mpShowWindow ) mpShowWindow->Hide(); + mpShowWindow.disposeAndClear(); if ( mpViewShell ) { diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 333e07bc9ad0..54330246c40b 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1977,11 +1977,11 @@ void SfxHelpTextWindow_Impl::dispose() bIsInClose = true; SvtMiscOptions().RemoveListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); - pSrchDlg.clear(); + pSrchDlg.disposeAndClear(); aToolBox.disposeAndClear(); aOnStartupCB.disposeAndClear(); pHelpWin.clear(); - pTextWin.clear(); + pTextWin.disposeAndClear(); vcl::Window::dispose(); } diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 8dd755cba732..555e55f56835 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -78,7 +78,7 @@ void ThumbnailView::dispose() if (xComponent.is()) xComponent->dispose (); - mpScrBar.clear(); + mpScrBar.disposeAndClear(); delete mpItemAttrs; delete mpProcessor; diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 3e2f0b0f2e44..8794ce044bcb 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -730,7 +730,7 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage, { SetUniqId(nSettingsId); - pImpl->m_pSfxPage.clear(); + pImpl->m_pSfxPage.disposeAndClear(); pImpl->m_pSfxPage = pTabPage; fnGetRanges = pRangesFunc; diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 3daafd2a5cff..5c7160d02c3a 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -258,7 +258,7 @@ SfxTitleDockingWindow::~SfxTitleDockingWindow() void SfxTitleDockingWindow::dispose() { - m_pWrappedWindow.clear(); + m_pWrappedWindow.disposeAndClear(); SfxDockingWindow::dispose(); } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index b8f63d54c85e..bd4a59c6b334 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -409,6 +409,16 @@ void SfxTabDialog::dispose() delete pExampleSet; delete [] pRanges; + if (m_bOwnsBaseFmtBtn) + m_pBaseFmtBtn.disposeAndClear() + if (m_bOwnsResetBtn) + m_pResetBtn.disposeAndClear() + if (m_bOwnsHelpBtn) + m_pHelpBtn.disposeAndClear() + if (m_bOwnsCancelBtn) + m_pCancelBtn.disposeAndClear() + if (m_bOwnsOKBtn) + m_pOKBtn.disposeAndClear() m_pBox.clear(); m_pTabCtrl.clear(); m_pOKBtn.clear(); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 72fde222b23c..9b728a078267 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1531,7 +1531,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable) } else { - pTreeBox.clear(); + pTreeBox.disposeAndClear(); aFmtLb->Show(); // If bHierarchical, then the family can have changed // minus one since hierarchical is inserted at the start diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index f74654602fdc..0b43ce07f6f8 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -335,7 +335,7 @@ SfxVersionDialog::~SfxVersionDialog() void SfxVersionDialog::dispose() { delete m_pTable; - m_pVersionBox.clear(); + m_pVersionBox.disposeAndClear(); m_pSaveButton.clear(); m_pSaveCheckBox.clear(); m_pOpenButton.clear(); @@ -592,7 +592,7 @@ SfxCmisVersionsDialog::~SfxCmisVersionsDialog() void SfxCmisVersionsDialog::dispose() { delete m_pTable; - m_pVersionBox.clear(); + m_pVersionBox.disposeAndClear(); m_pOpenButton.clear(); m_pViewButton.clear(); m_pDeleteButton.clear(); diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx index fdaaeb4aae67..bbbd07e28db7 100644 --- a/sfx2/source/sidebar/SidebarPanelBase.cxx +++ b/sfx2/source/sidebar/SidebarPanelBase.cxx @@ -81,7 +81,7 @@ SidebarPanelBase::~SidebarPanelBase (void) void SAL_CALL SidebarPanelBase::disposing (void) throw (css::uno::RuntimeException) { - mpControl.clear(); + mpControl.disposeAndClear(); if (mxFrame.is()) { diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 6afaec6536eb..c1df7877299e 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -209,7 +209,7 @@ IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent if (( pWindow == mpFloatingWindow ) && ( mpPopupWindow != nullptr )) { - mpPopupWindow.clear(); + mpPopupWindow.disposeAndClear(); } } @@ -291,8 +291,8 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (::com::sun::star::uno::Runtime pImpl->mxUIElement = 0; // Delete my popup windows - pImpl->mpFloatingWindow.clear(); - pImpl->mpPopupWindow.clear(); + pImpl->mpFloatingWindow.disposeAndClear(); + pImpl->mpPopupWindow.disposeAndClear(); } @@ -862,7 +862,7 @@ IMPL_LINK_NOARG(SfxToolBoxControl, PopupModeEndHdl) { // Replace floating window with popup window and destroy // floating window instance. - pImpl->mpFloatingWindow.clear(); + pImpl->mpFloatingWindow.disposeAndClear(); pImpl->mpFloatingWindow = pImpl->mpPopupWindow; pImpl->mpPopupWindow.clear(); // We also need to know when the user tries to use the diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 635ccf0bf89f..c9594f2ccf0c 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -235,7 +235,7 @@ SfxPrintOptionsDialog::~SfxPrintOptionsDialog() void SfxPrintOptionsDialog::dispose() { delete pDlgImpl; - pPage.clear(); + pPage.disposeAndClear(); delete pOptions; ModalDialog::dispose(); } diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 0b472e2efae9..0170bd744d0c 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -676,7 +676,7 @@ SmElementsDockingWindow::~SmElementsDockingWindow () void SmElementsDockingWindow::dispose() { - mpElementsControl.clear(); + mpElementsControl.disposeAndClear(); mpElementListBox.clear(); SfxDockingWindow::dispose(); } diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index dfd1595bdf1b..18f8696db25e 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -156,9 +156,9 @@ void SmEditWindow::dispose() pEditView = NULL; } - pHScrollBar.clear(); - pVScrollBar.clear(); - pScrollBox.clear(); + pHScrollBar.disposeAndClear(); + pVScrollBar.disposeAndClear(); + pScrollBox.disposeAndClear(); vcl::Window::dispose(); } diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx index 0b514fdf2c06..7d14a1e0db2c 100644 --- a/starmath/source/toolbox.cxx +++ b/starmath/source/toolbox.cxx @@ -146,9 +146,8 @@ void SmToolBoxWindow::dispose() { int i; for (i = 0; i < NUM_TBX_CATEGORIES; ++i) - { - vToolBoxCategories[i].clear(); - } + vToolBoxCategories[i].disposeAndClear(); + pToolBoxCmd = 0; for (i = 0; i < NUM_TBX_CATEGORIES + 1; ++i) { diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 6650cbd44e52..6c09611863f6 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -153,10 +153,10 @@ void BrowseBox::dispose() } Hide(); - getDataWindow()->pHeaderBar.clear(); - getDataWindow()->pCornerWin.clear(); + getDataWindow()->pHeaderBar.disposeAndClear(); + getDataWindow()->pCornerWin.disposeAndClear(); pDataWin.clear(); - pVScroll.clear(); + pVScroll.disposeAndClear(); aHScroll.disposeAndClear(); // free columns-space @@ -2255,7 +2255,7 @@ void BrowseBox::SetMode( BrowserMode nMode ) MultiSelection *pOldRowSel = bMultiSelection ? uRow.pSel : 0; MultiSelection *pOldColSel = pColSel; - pVScroll.clear(); + pVScroll.disposeAndClear(); bThumbDragging = ( nMode & BROWSER_THUMBDRAGGING ) == BROWSER_THUMBDRAGGING; bMultiSelection = ( nMode & BROWSER_MULTISELECTION ) == BROWSER_MULTISELECTION; @@ -2408,7 +2408,7 @@ BrowserHeader* BrowseBox::CreateHeaderBar( BrowseBox* pParent ) void BrowseBox::SetHeaderBar( BrowserHeader* pHeaderBar ) { - static_cast<BrowserDataWin*>( pDataWin.get() )->pHeaderBar.clear(); + static_cast<BrowserDataWin*>( pDataWin.get() )->pHeaderBar.disposeAndClear(); static_cast<BrowserDataWin*>( pDataWin.get() )->pHeaderBar = pHeaderBar; static_cast<BrowserDataWin*>( pDataWin.get() )->pHeaderBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) ); } diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx index 532e3409dba4..9e008600925e 100644 --- a/svtools/source/brwbox/ebbcontrols.cxx +++ b/svtools/source/brwbox/ebbcontrols.cxx @@ -254,7 +254,7 @@ namespace svt void CheckBoxControl::dispose() { - pBox.clear(); + pBox.disposeAndClear(); Control::dispose(); } diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 1dc9adf8f4ac..c376113b6d53 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -195,7 +195,7 @@ namespace svt if (nCellModifiedEvent) Application::RemoveUserEvent(nCellModifiedEvent); - pCheckBoxPaint.clear(); + pCheckBoxPaint.disposeAndClear(); m_pFocusWhileRequest.clear(); pHeader.clear(); BrowseBox::dispose(); diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index accd044b9e50..23a3172a8a49 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -642,7 +642,7 @@ void ViewTabListBox_Impl::dispose() { maResetQuickSearch.Stop(); - mpHeaderBar.clear(); + mpHeaderBar.disposeAndClear(); SvHeaderTabListBox::dispose(); } diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index ae35ee1fd6a5..25551159f227 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -166,7 +166,7 @@ SvInplaceEdit2::~SvInplaceEdit2() Application::RemoveAccel( &aAccReturn ); Application::RemoveAccel( &aAccEscape ); } - pEdit.clear(); + pEdit.disposeAndClear(); } OUString SvInplaceEdit2::GetSavedValue() const diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index 02a8e135cf13..86271a9444fc 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -2229,9 +2229,9 @@ ImplCFieldFloatWin::~ImplCFieldFloatWin() void ImplCFieldFloatWin::dispose() { - mpTodayBtn.clear(); - mpNoneBtn.clear(); - mpFixedLine.clear(); + mpTodayBtn.disposeAndClear(); + mpNoneBtn.disposeAndClear(); + mpFixedLine.disposeAndClear(); mpCalendar.clear(); FloatingWindow::dispose(); } @@ -2258,7 +2258,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( bool bEnable ) } else { - mpTodayBtn.clear(); + mpTodayBtn.disposeAndClear(); } return mpTodayBtn; @@ -2286,7 +2286,7 @@ PushButton* ImplCFieldFloatWin::EnableNoneBtn( bool bEnable ) } else { - mpNoneBtn.clear(); + mpNoneBtn.disposeAndClear(); } return mpNoneBtn; @@ -2350,7 +2350,7 @@ void ImplCFieldFloatWin::ArrangeButtons() } else { - mpFixedLine.clear(); + mpFixedLine.disposeAndClear(); } } @@ -2388,8 +2388,8 @@ CalendarField::~CalendarField() void CalendarField::dispose() { - mpCalendar.clear(); - mpFloatWin.clear(); + mpCalendar.disposeAndClear(); + mpFloatWin.disposeAndClear(); mpTodayBtn.clear(); mpNoneBtn.clear(); DateField::dispose(); diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index 1cf6fc5b1100..5f83f15061fd 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -129,7 +129,7 @@ ToolbarMenuEntry::~ToolbarMenuEntry() xComponent->dispose(); mxAccContext.clear(); } - mpControl.clear(); + mpControl.disposeAndClear(); } diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 6cf4a62e5301..e0cf0f994310 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -207,11 +207,11 @@ namespace svt void OWizardMachine::dispose() { - m_pFinish.clear(); - m_pCancel.clear(); - m_pNextPage.clear(); - m_pPrevPage.clear(); - m_pHelp.clear(); + m_pFinish.disposeAndClear(); + m_pCancel.disposeAndClear(); + m_pNextPage.disposeAndClear(); + m_pPrevPage.disposeAndClear(); + m_pHelp.disposeAndClear(); for (WizardState i=0; i<m_pImpl->nFirstUnknownPage; ++i) delete GetPage(i); diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx index 4026b669386e..8c70e93f1184 100644 --- a/svtools/source/uno/genericunodialog.cxx +++ b/svtools/source/uno/genericunodialog.cxx @@ -313,7 +313,7 @@ void SAL_CALL OGenericUnoDialog::initialize( const Sequence< Any >& aArguments ) void OGenericUnoDialog::destroyDialog() { - m_pDialog.clear(); + m_pDialog.disposeAndClear(); } diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 535133608bb0..2d528fdff1e7 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -491,11 +491,11 @@ SvxBmpMask::~SvxBmpMask() void SvxBmpMask::dispose() { - m_pQSet1.clear(); - m_pQSet2.clear(); - m_pQSet3.clear(); - m_pQSet4.clear(); - m_pCtlPipette.clear(); + m_pQSet1.disposeAndClear(); + m_pQSet2.disposeAndClear(); + m_pQSet3.disposeAndClear(); + m_pQSet4.disposeAndClear(); + m_pCtlPipette.disposeAndClear(); delete pData; m_pTbxPipette.clear(); m_pBtnExec.clear(); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index b3e041eeed30..2ed20dfb2d9a 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -301,7 +301,7 @@ void SvxSuperContourDlg::dispose() { SvtMiscOptions aMiscOptions; aMiscOptions.RemoveListenerLink( LINK(this, SvxSuperContourDlg, MiscHdl) ); - m_pContourWnd.clear(); + m_pContourWnd.disposeAndClear(); m_pTbx1.clear(); m_pMtfTolerance.clear(); m_pStbStatus.clear(); diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index ac7957d8061c..81551a1ab095 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -423,7 +423,7 @@ SvxTPView::~SvxTPView() void SvxTPView::dispose() { - m_pViewData.clear(); + m_pViewData.disposeAndClear(); m_pAccept.clear(); m_pReject.clear(); m_pAcceptAll.clear(); @@ -1119,8 +1119,8 @@ SvxAcceptChgCtr::~SvxAcceptChgCtr() void SvxAcceptChgCtr::dispose() { disposeBuilder(); - pTPFilter.clear(); - pTPView.clear(); + pTPView.disposeAndClear(); + pTPFilter.disposeAndClear(); TabControl::dispose(); } diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index a2e705e144f0..3ddca61f7196 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -163,14 +163,7 @@ SvxFontWorkChildWindow::SvxFontWorkChildWindow SfxChildWindow( _pParent, nId ) { -<<<<<<< HEAD - SvxFontWorkDialog* pDlg = new SvxFontWorkDialog(pBindings, this, _pParent); - pWindow = pDlg; -======= - pWindow = new SvxFontWorkDialog( pBindings, this, _pParent, - SVX_RES( RID_SVXDLG_FONTWORK ) ); - SvxFontWorkDialog* pDlg = static_cast<SvxFontWorkDialog*>(pWindow.get()); ->>>>>>> 765a16f... vclwidget: change all vcl::window fields to be wrapped in VclPtr + pWindow = VclPtrInstance<SvxFontWorkDialog>(pBindings, this, _pParent); eChildAlignment = SfxChildAlignment::NOALIGNMENT; diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index b7a9c2e256d9..2e545e0914bf 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -223,7 +223,7 @@ SvxIMapDlg::~SvxIMapDlg() void SvxIMapDlg::dispose() { // Delete URL-List - pIMapWnd.clear(); + pIMapWnd.disposeAndClear(); delete pOwnData; m_pTbxIMapDlg1.clear(); m_pFtURL.clear(); diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index b6823a2e0ae5..06d105eaafda 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2948,7 +2948,7 @@ namespace svxform void NamespaceItemDialog::dispose() { - m_pNamespacesList.clear(); + m_pNamespacesList.disposeAndClear(); m_pAddNamespaceBtn.clear(); m_pEditNamespaceBtn.clear(); m_pDeleteNamespaceBtn.clear(); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index ccfce934dbb2..ec5bd20a506f 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1872,7 +1872,7 @@ FmFilterNavigatorWin::~FmFilterNavigatorWin() void FmFilterNavigatorWin::dispose() { - m_pNavigator.clear(); + m_pNavigator.disposeAndClear(); SfxDockingWindow::dispose(); } diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 635d53f1e94f..e69a7b55590b 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -519,7 +519,7 @@ namespace svxform void NavigatorFrame::dispose() { - m_pNavigatorTree.clear(); + m_pNavigatorTree.disposeAndClear(); SfxDockingWindow::dispose(); } diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index e64bd9a96ded..55c8009f42db 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -152,7 +152,7 @@ GalleryBrowser1::~GalleryBrowser1() void GalleryBrowser1::dispose() { EndListening( *mpGallery ); - mpThemes.clear(); + mpThemes.disposeAndClear(); delete mpExchangeData; mpExchangeData = NULL; maNewTheme.disposeAndClear(); diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 15bfd3646a2f..3aae480832b1 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -481,9 +481,9 @@ void GalleryBrowser2::dispose() { maMiscOptions.RemoveListenerLink( LINK( this, GalleryBrowser2, MiscHdl ) ); - mpPreview.clear(); - mpListView.clear(); - mpIconView.clear(); + mpPreview.disposeAndClear(); + mpListView.disposeAndClear(); + mpIconView.disposeAndClear(); if( mpCurTheme ) mpGallery->ReleaseTheme( mpCurTheme, *this ); @@ -740,9 +740,9 @@ bool GalleryBrowser2::KeyInput( const KeyEvent& rKEvt, vcl::Window* pWindow ) void GalleryBrowser2::SelectTheme( const OUString& rThemeName ) { - mpIconView.clear(); - mpListView.clear(); - mpPreview.clear(); + mpIconView.disposeAndClear(); + mpListView.disposeAndClear(); + mpPreview.disposeAndClear(); if( mpCurTheme ) mpGallery->ReleaseTheme( mpCurTheme, *this ); diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index cc0b28dd59eb..42a990477c5c 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -218,7 +218,7 @@ _SdrItemBrowserControl::~_SdrItemBrowserControl() void _SdrItemBrowserControl::dispose() { - pEditControl.clear(); + pEditControl.disposeAndClear(); delete pAktChangeEntry; @@ -532,7 +532,7 @@ bool _SdrItemBrowserControl::EndChangeEntry() bool bRet = false; if (pEditControl!=nullptr) { aEntryChangedHdl.Call(this); - pEditControl.clear(); + pEditControl.disposeAndClear(); delete pAktChangeEntry; pAktChangeEntry=NULL; vcl::Window* pParent=GetParent(); @@ -546,7 +546,7 @@ bool _SdrItemBrowserControl::EndChangeEntry() void _SdrItemBrowserControl::BrkChangeEntry() { if (pEditControl!=nullptr) { - pEditControl.clear(); + pEditControl.disposeAndClear(); delete pAktChangeEntry; pAktChangeEntry=NULL; vcl::Window* pParent=GetParent(); diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index a30737b72f9a..7ee54bfd1370 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -235,7 +235,7 @@ SdrPaintView::~SdrPaintView() ClearPageView(); #ifdef DBG_UTIL - pItemBrowser.clear(); + pItemBrowser.disposeAndClear(); #endif // delete existing SdrPaintWindows @@ -1132,7 +1132,7 @@ void SdrPaintView::ShowItemBrowser(bool bShow) } else { if (pItemBrowser!=nullptr) { pItemBrowser->Hide(); - pItemBrowser.clear(); + pItemBrowser.disposeAndClear(); } } } diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index eb677739acf1..775fc0184b0e 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -567,8 +567,8 @@ FillControl::~FillControl() void FillControl::dispose() { - mpLbFillType.clear(); - mpLbFillAttr.clear(); + mpLbFillType.disposeAndClear(); + mpLbFillAttr.disposeAndClear(); vcl::Window::dispose(); } diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index 18bb2ba05bc9..27611b06831f 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -343,7 +343,7 @@ throw (uno::RuntimeException, std::exception) svt::ToolboxController::dispose(); SolarMutexGuard aSolarMutexGuard; - m_pBox.clear(); + m_pBox.disposeAndClear(); } // XStatusListener diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 1d175ff54704..d10d5b53326f 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -660,7 +660,7 @@ void SAL_CALL MatchCaseToolboxController::dispose() throw ( css::uno::RuntimeExc svt::ToolboxController::dispose(); - m_pMatchCaseControl.clear(); + m_pMatchCaseControl.disposeAndClear(); } // XInitialization diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx index 7cdf4a98f9ef..5a2f76e5013b 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx @@ -58,7 +58,7 @@ void ChineseTranslation_UnoDialog::impl_DeleteDialog() { if(m_pDialog->IsInExecute()) m_pDialog->EndDialog(RET_CANCEL); - m_pDialog.clear(); + m_pDialog.disposeAndClear(); } } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx index feaaf3bbc392..6c0f0401e1ec 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx @@ -73,7 +73,7 @@ void ChineseTranslationDialog::dispose() if(m_pDictionaryDialog->IsInExecute()) m_pDictionaryDialog->EndDialog(); } - m_pDictionaryDialog.clear(); + m_pDictionaryDialog.disposeAndClear(); m_pRB_To_Simplified.clear(); m_pRB_To_Traditional.clear(); m_pCB_Translate_Commonterms.clear(); diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 71d69b25823c..388c6d3be39b 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -277,8 +277,8 @@ void SwAddressListDialog::dispose() delete pUserData; pEntry = m_pListLB->Next( pEntry ); } + m_pListLB.disposeAndClear(); m_pAddressPage.clear(); - m_pListLB.clear(); m_pDescriptionFI.clear(); m_pLoadListPB.clear(); m_pCreateListPB.clear(); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index d54a313ac875..fb86a0eef99a 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -507,7 +507,7 @@ void SwCreateAddressListDialog::dispose() m_pNextPB.clear(); m_pEndPB.clear(); m_pOK.clear(); - m_pFindDlg.clear(); + m_pFindDlg.disposeAndClear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index c31485ad971c..eb992058b7e4 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -152,7 +152,7 @@ SwSelectDBTableDialog::~SwSelectDBTableDialog() void SwSelectDBTableDialog::dispose() { - m_pTable.clear(); + m_pTable.disposeAndClear(); m_pPreviewPB.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 01eab608b18c..7a8e03665d1a 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -219,11 +219,11 @@ SwColumnDlg::~SwColumnDlg() void SwColumnDlg::dispose() { + pTabPage.disposeAndClear(); delete pPageSet; delete pSectionSet; delete pSelectionSet; m_pApplyToLB.clear(); - pTabPage.clear(); SfxModalDialog::dispose(); } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 589d1a75ded7..784cfc0e383e 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -723,7 +723,7 @@ SwAddStylesDlg_Impl::~SwAddStylesDlg_Impl() void SwAddStylesDlg_Impl::dispose() { - m_pHeaderTree.clear(); + m_pHeaderTree.disposeAndClear(); m_pOk.clear(); m_pLeftPB.clear(); m_pRightPB.clear(); @@ -2767,10 +2767,9 @@ void SwTokenWindow::dispose() { for (ctrl_iterator it = aControlList.begin(); it != aControlList.end(); ++it) { - Control* pControl = (*it); - pControl->SetGetFocusHdl( Link() ); - pControl->SetLoseFocusHdl( Link() ); - delete pControl; + it->SetGetFocusHdl( Link() ); + it->SetLoseFocusHdl( Link() ); + it->disposeAndClear(); } aControlList.clear(); disposeBuilder(); @@ -2790,6 +2789,8 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) if(pForm) { //apply current level settings to the form + for (auto it = aControlList.begin(); it != aControlList.end(); ++it) + it->disposeAndClear(); aControlList.clear(); } @@ -3133,7 +3134,7 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& { iterActive = aControlList.erase(iterActive); pActiveCtrl->Hide(); - pActiveCtrl.clear(); + pActiveCtrl.disposeAndClear(); } //now the new button @@ -3198,7 +3199,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, bool bInternalCall ) aControlList.erase(it); pActiveCtrl->Hide(); - pActiveCtrl.clear(); + pActiveCtrl.disposeAndClear(); SetActiveControl(pLeftEdit); AdjustPositions(); @@ -4216,7 +4217,7 @@ SwAutoMarkDlg_Impl::~SwAutoMarkDlg_Impl() void SwAutoMarkDlg_Impl::dispose() { - m_pEntriesBB.clear(); + m_pEntriesBB.disposeAndClear(); m_pOKPB.clear(); ModalDialog::dispose(); } diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 75e48ab27b8a..653ba8bd8465 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1534,11 +1534,11 @@ void SwCreateAuthEntryDlg_Impl::dispose() { for(int i = 0; i < AUTH_FIELD_END; i++) { - pFixedTexts[i].clear(); - pEdits[i].clear(); + pFixedTexts[i].disposeAndClear(); + pEdits[i].disposeAndClear(); } - pTypeListBox.clear(); - pIdentifierBox.clear(); + pTypeListBox.disposeAndClear(); + pIdentifierBox.disposeAndClear(); m_pOKBT.clear(); ModalDialog::dispose(); } diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 12d958655b91..c415f6ef19db 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -175,7 +175,7 @@ SwHeaderFooterWin::~SwHeaderFooterWin( ) void SwHeaderFooterWin::dispose() { delete m_pPopupMenu; - m_pLine.clear(); + m_pLine.disposeAndClear(); MenuButton::dispose(); } diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index b8e459dcf2ce..cc09543dad5b 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -126,12 +126,12 @@ void SwPageBreakWin::dispose() m_bDestroyed = true; m_aFadeTimer.Stop(); + m_pLine.disposeAndClear(); delete m_pPopupMenu; m_pPopupMenu = NULL; delete m_pMousePt; m_pMousePt = NULL; - m_pLine.clear(); MenuButton::dispose(); } diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 4db2d5d8ab6f..296ba3be0ac4 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -157,7 +157,7 @@ void SwSidebarWin::dispose() mpOutlinerView->SetWindow( 0 ); } } - mpSidebarTxtControl.clear(); + mpSidebarTxtControl.disposeAndClear(); if ( mpOutlinerView ) { @@ -175,19 +175,19 @@ void SwSidebarWin::dispose() { mpMetadataAuthor->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); } - mpMetadataAuthor.clear(); + mpMetadataAuthor.disposeAndClear(); if (mpMetadataDate) { mpMetadataDate->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); } - mpMetadataDate.clear(); + mpMetadataDate.disposeAndClear(); if (mpVScrollbar) { mpVScrollbar->RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); } - mpVScrollbar.clear(); + mpVScrollbar.disposeAndClear(); RemoveEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); @@ -200,7 +200,7 @@ void SwSidebarWin::dispose() delete mpTextRangeOverlay; mpTextRangeOverlay = NULL; - mpMenuButton.clear(); + mpMenuButton.disposeAndClear(); if (mnEventId) Application::RemoveUserEvent( mnEventId ); diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 0522f13caee1..f46685bc8a9b 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -292,9 +292,9 @@ void SwSrcEditWindow::dispose() delete pTextView; delete pTextEngine; } - pOutWin.clear(); - pHScrollbar.clear(); - pVScrollbar.clear(); + pHScrollbar.disposeAndClear(); + pVScrollbar.disposeAndClear(); + pOutWin.disposeAndClear(); vcl::Window::dispose(); } diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index ca9059586706..4fb3b9f891fa 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -453,7 +453,7 @@ SwScrollNaviPopup::~SwScrollNaviPopup() void SwScrollNaviPopup::dispose() { - m_pToolBox.clear(); + m_pToolBox.disposeAndClear(); m_pInfoField.clear(); SfxPopupWindow::dispose(); } diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx index 6e9c39f62f51..47a3477f2795 100644 --- a/sw/source/uibase/sidebar/PageColumnControl.cxx +++ b/sw/source/uibase/sidebar/PageColumnControl.cxx @@ -82,7 +82,7 @@ PageColumnControl::~PageColumnControl(void) void PageColumnControl::dispose() { - mpColumnValueSet.clear(); + mpColumnValueSet.disposeAndClear(); maMoreButton.disposeAndClear(); ::svx::sidebar::PopupControl::dispose(); } diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 46eb3960b2f4..14f6befa643b 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -138,7 +138,7 @@ PageMarginControl::~PageMarginControl() void PageMarginControl::dispose() { - mpMarginValueSet.clear(); + mpMarginValueSet.disposeAndClear(); StoreUserCustomValues(); diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index c4d9357d0d4f..2ca13753f5f5 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -68,7 +68,7 @@ PageOrientationControl::~PageOrientationControl(void) void PageOrientationControl::dispose() { - mpOrientationValueSet.clear(); + mpOrientationValueSet.disposeAndClear(); ::svx::sidebar::PopupControl::dispose(); } diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx index 0906c8f02a2c..5218a7844992 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -148,7 +148,7 @@ PageSizeControl::~PageSizeControl() void PageSizeControl::dispose() { - mpSizeValueSet.clear(); + mpSizeValueSet.disposeAndClear(); maMoreButton.disposeAndClear(); maWidthHeightField.disposeAndClear(); ::svx::sidebar::PopupControl::dispose(); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 350cf294f21d..77759cb41ea2 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1051,18 +1051,18 @@ SwView::~SwView() m_pViewImpl->Invalidate(); EndListening(*GetViewFrame()); EndListening(*GetDocShell()); - m_pScrollFill.clear(); + m_pScrollFill.disposeAndClear(); delete m_pWrtShell; m_pWrtShell = 0; // Set to 0, so that it is not accessible by the following dtors cannot. m_pShell = 0; - m_pHScrollbar.clear(); - m_pVScrollbar.clear(); - m_pHRuler.clear(); - m_pVRuler.clear(); - m_pTogglePageBtn.clear(); + m_pHScrollbar.disposeAndClear(); + m_pVScrollbar.disposeAndClear(); + m_pHRuler.disposeAndClear(); + m_pVRuler.disposeAndClear(); + m_pTogglePageBtn.disposeAndClear(); delete m_pGlosHdl; delete m_pViewImpl; - m_pEditWin.clear(); + m_pEditWin.disposeAndClear(); delete m_pFormatClipboard; } diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 98a9da9d14c5..35395a0e6f99 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -888,7 +888,7 @@ IMPL_LINK( SwFieldDialog, MyListBoxHandler, ListBox *, pBox ) IMPL_LINK_NOARG(SwView, FieldPopupModeEndHdl) { - m_pFieldPopup.clear(); + m_pFieldPopup.disposeAndClear(); return 0; } diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index c1fbaec60ba0..0f506394ce54 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -871,8 +871,8 @@ void SwNavigationPI::dispose() if ( IsBound() ) rBindings.Release(*this); - pPopupWindow.clear(); - pFloatingWindow.clear(); + pPopupWindow.disposeAndClear(); + pFloatingWindow.disposeAndClear(); aContentToolBox.disposeAndClear(); aGlobalToolBox.disposeAndClear(); aContentTree.disposeAndClear(); diff --git a/vcl/generic/print/prtsetup.cxx b/vcl/generic/print/prtsetup.cxx index 57839084eac5..a67c9de91ed2 100644 --- a/vcl/generic/print/prtsetup.cxx +++ b/vcl/generic/print/prtsetup.cxx @@ -101,8 +101,8 @@ void RTSDialog::dispose() m_pTabControl.clear(); m_pOKButton.clear(); m_pCancelButton.clear(); - m_pPaperPage.clear(); - m_pDevicePage.clear(); + m_pPaperPage.disposeAndClear(); + m_pDevicePage.disposeAndClear(); TabDialog::dispose(); } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 89a2fe1ac156..969cadc9007e 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -74,14 +74,9 @@ ComboBox::~ComboBox() void ComboBox::dispose() { mpSubEdit.disposeAndClear(); - - ImplListBox *pImplLB = mpImplLB; - mpImplLB = NULL; - delete pImplLB; - - mpFloatWin.clear(); - mpBtn.clear(); - mpImplLB.clear(); + mpImplLB.disposeAndClear(); + mpFloatWin.disposeAndClear(); + mpBtn.disposeAndClear(); Edit::dispose(); } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 78e0146a7938..1e50eee4dfe8 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -77,10 +77,10 @@ void ListBox::dispose() { CallEventListeners( VCLEVENT_OBJECT_DYING ); - mpFloatWin.clear(); - mpImplWin.clear(); - mpBtn.clear(); - mpImplLB.clear(); + mpImplLB.disposeAndClear(); + mpFloatWin.disposeAndClear(); + mpImplWin.disposeAndClear(); + mpBtn.disposeAndClear(); Control::dispose(); } diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 60ade3ac9845..9821154e062c 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1331,7 +1331,7 @@ void PrinterController::abortJob() // applications (well, sw) depend on a page request with "IsLastPage" = true // to free resources, else they (well, sw) will crash eventually setLastPage( true ); - mpImplData->mpProgress.clear(); + mpImplData->mpProgress.disposeAndClear(); GDIMetaFile aMtf; getPageFile( 0, aMtf, false ); } diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 90b436eddd33..ab5b04de0ab2 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -1185,7 +1185,7 @@ IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd) GetWindow()->SetParent( pRealParent ); GetWindow()->mpWindowImpl->mpRealParent = pRealParent; - mpFloatWin.clear(); + mpFloatWin.disposeAndClear(); // call handler - which will destroy the window and thus the wrapper as well ! GetWindow()->CallEventListeners( VCLEVENT_WINDOW_ENDPOPUPMODE, &aData ); diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 743983c87952..853e759f81d2 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -877,8 +877,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode ) mpWindowImpl->mpBorderWindow = mpOldBorderWin; SetParent( pRealParent ); mpWindowImpl->mpRealParent = pRealParent; - mpFloatWin.clear(); - mpFloatWin = NULL; + mpFloatWin.disposeAndClear(); SetPosPixel( maDockPos ); ToggleFloatingMode(); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 1d691c0d9067..e763b776d3b2 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1478,6 +1478,12 @@ bool VclAlignment::set_property(const OString &rKey, const OString &rValue) return true; } +void VclExpander::dispose() +{ + m_pDisclosureButton.disposeAndClear(); + VclBin::dispose(); +} + const vcl::Window *VclExpander::get_child() const { const WindowImpl* pWindowImpl = ImplGetWindowImpl(); @@ -1632,6 +1638,14 @@ VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent, WinBits nStyle) m_pHScroll->SetScrollHdl(aLink); } +void VclScrolledWindow::dispose() +{ + m_pVScroll.disposeAndClear(); + m_pHScroll.disposeAndClear(); + m_aScrollBarBox.disposeAndClear(); + VclBin::dispose(); +} + IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl) { vcl::Window *pChild = get_child(); diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 64bce64a7eb3..5527aa5edd0c 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -156,9 +156,9 @@ MessBox::~MessBox() void MessBox::dispose() { - mpVCLMultiLineEdit.clear(); - mpFixedImage.clear(); - mpCheckBox.clear(); + mpVCLMultiLineEdit.disposeAndClear(); + mpFixedImage.disposeAndClear(); + mpCheckBox.disposeAndClear(); ButtonDialog::dispose(); } @@ -196,12 +196,12 @@ void MessBox::ImplPosControls() WinBits nWinStyle = WB_LEFT | WB_NOLABEL; sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT; - mpVCLMultiLineEdit.clear(); - mpFixedImage.clear(); + mpVCLMultiLineEdit.disposeAndClear(); + mpFixedImage.disposeAndClear(); if ( mpCheckBox ) { mbCheck = mpCheckBox->IsChecked(); - mpCheckBox.clear(); + mpCheckBox.disposeAndClear(); } // Clean up message text with tabs diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 02220ba58860..4f52d5c491ad 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -226,7 +226,7 @@ TabDialog::~TabDialog() void TabDialog::dispose() { - mpFixedLine.clear(); + mpFixedLine.disposeAndClear(); mpViewWindow.clear(); Dialog::dispose(); } diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index f6c8cc9f9bbc..28050b6b5e44 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -86,7 +86,7 @@ CertificateChooser::~CertificateChooser() void CertificateChooser::dispose() { - m_pCertLB.clear(); + m_pCertLB.disposeAndClear(); m_pViewBtn.clear(); m_pOKBtn.clear(); ModalDialog::dispose(); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 544e859febe2..5c77f69e2d1d 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -299,8 +299,8 @@ CertificateViewerDetailsTP::~CertificateViewerDetailsTP() void CertificateViewerDetailsTP::dispose() { Clear(); + m_pElementsLB.disposeAndClear(); m_pElementsLBContainer.clear(); - m_pElementsLB.clear(); m_pValueDetails.clear(); CertificateViewerTP::dispose(); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 03e9cfc26842..9cfde2bec778 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -240,10 +240,10 @@ DigitalSignaturesDialog::~DigitalSignaturesDialog() void DigitalSignaturesDialog::dispose() { + m_pSignaturesLB.disposeAndClear(); m_pHintDocFT.clear(); m_pHintBasicFT.clear(); m_pHintPackageFT.clear(); - m_pSignaturesLB.clear(); m_pSigsValidImg.clear(); m_pSigsValidFI.clear(); m_pSigsInvalidImg.clear(); diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx index 9a7a0685215f..6ff60ac94dbd 100644 --- a/xmlsecurity/source/dialogs/macrosecurity.cxx +++ b/xmlsecurity/source/dialogs/macrosecurity.cxx @@ -435,7 +435,7 @@ MacroSecurityTrustedSourcesTP::~MacroSecurityTrustedSourcesTP() void MacroSecurityTrustedSourcesTP::dispose() { - m_pTrustCertLB.clear(); + m_pTrustCertLB.disposeAndClear(); m_pTrustCertROFI.clear(); m_pViewCertPB.clear(); m_pRemoveCertPB.clear(); |