summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-10 10:44:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 10:46:01 +0100
commitc0a802b59e1edddeb0b621e15137f5058299efd7 (patch)
tree48203cffcd51d1d2747bb2384608907d73b69670 /sw
parent1c4025babd7037a3292aa530c7d45ab8d6ef6dcb (diff)
Audit and correct misc. clears -> disposeAndClears.
Anything that used to be 'delete'd should be disposeAndCleared() in the new world.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx2
-rw-r--r--sw/source/ui/frmdlg/column.cxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx17
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx8
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx2
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx10
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx6
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.cxx2
-rw-r--r--sw/source/uibase/uiview/view.cxx14
-rw-r--r--sw/source/uibase/uiview/viewling.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx4
18 files changed, 42 insertions, 41 deletions
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();