summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-13 15:06:22 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-13 15:10:32 +0100
commitc9f2abed2e8a618bdf1237c162cb2073bb7022e0 (patch)
tree7bb0157b473856818350a896afefe4af33244130
parentc6fb78d5fd5f52384f4b959091f50da60ba4b37a (diff)
More lifecycle correction.
Another (complete) audit of delete usage in: "vclwidget: change all vcl::window fields to be wrapped in VclPtr" Change-Id: I828212ded66ecc5cc30c75a4de626c7b386cb77a
-rw-r--r--avmedia/source/framework/mediacontrol.cxx2
-rw-r--r--basctl/source/basicide/baside2b.cxx2
-rw-r--r--cui/source/customize/cfg.cxx8
-rw-r--r--cui/source/tabpages/autocdlg.cxx6
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx2
-rw-r--r--formula/source/ui/dlg/funcutl.cxx2
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx6
-rw-r--r--sfx2/source/appl/newhelp.cxx5
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx10
-rw-r--r--sfx2/source/sidebar/Deck.cxx29
-rw-r--r--sfx2/source/sidebar/Deck.hxx2
-rw-r--r--sfx2/source/sidebar/Panel.cxx8
-rw-r--r--sfx2/source/sidebar/Panel.hxx2
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx9
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--svx/source/form/tabwin.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx4
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx2
-rw-r--r--vcl/source/window/btndlg.cxx8
-rw-r--r--vcl/source/window/layout.cxx1
20 files changed, 42 insertions, 70 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index baf1acfe8949..e6c680e45d3d 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/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index e7784af04dc2..076aa3e08506 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2875,7 +2875,7 @@ CodeCompleteWindow::~CodeCompleteWindow()
void CodeCompleteWindow::dispose()
{
- pListBox.clear();
+ pListBox.disposeAndClear();
pParent.clear();
vcl::Window::dispose();
}
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 248c765cb2ef..89a79b7a7309 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1568,14 +1568,14 @@ void SvxConfigPage::dispose()
m_pContents.clear();
m_pContentsLabel.clear();
m_pEntries.clear();
- m_pContentsListBox.clear();
+ m_pContentsListBox.disposeAndClear();
m_pAddCommandsButton.clear();
m_pModifyCommandButton.clear();
m_pMoveUpButton.clear();
m_pMoveDownButton.clear();
m_pSaveInListBox.clear();
m_pDescriptionField.clear();
- m_pSelectorDlg.clear();
+ m_pSelectorDlg.disposeAndClear();
SfxTabPage::dispose();
}
@@ -2979,8 +2979,8 @@ void SvxToolbarConfigPage::dispose()
}
m_pSaveInListBox->Clear();
- m_pSelectorDlg.clear();
- m_pContentsListBox.clear();
+ m_pSelectorDlg.disposeAndClear();
+ m_pContentsListBox.disposeAndClear();
SvxConfigPage::dispose();
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 0d8b428c0261..b74c37eade77 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -508,7 +508,7 @@ void OfaSwAutoFmtOptionsPage::dispose()
delete pCheckButtonData;
pCheckButtonData = NULL;
}
- m_pCheckLB.clear();
+ m_pCheckLB.disposeAndClear();
m_pEditPB.clear();
SfxTabPage::dispose();
}
@@ -1892,8 +1892,8 @@ void OfaQuoteTabPage::dispose()
{
delete pCheckButtonData;
pCheckButtonData = NULL;
- m_pSwCheckLB.clear();
- m_pCheckLB.clear();
+ m_pSwCheckLB.disposeAndClear();
+ m_pCheckLB.disposeAndClear();
m_pSingleTypoCB.clear();
m_pSglStartQuotePB.clear();
m_pSglStartExFT.clear();
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index cf9bc118dca5..5f9643b3b6db 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -265,7 +265,7 @@ OWizTypeSelect::~OWizTypeSelect()
void OWizTypeSelect::dispose()
{
- m_pTypeControl.clear();
+ m_pTypeControl.disposeAndClear();
m_pColumnNames.clear();
m_pColumns.clear();
m_pAutoType.clear();
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index c6747f9dfc94..716dc88c1d24 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -380,7 +380,7 @@ EditBox::~EditBox()
void EditBox::dispose()
{
pMEdit->Disable();
- pMEdit.clear();
+ pMEdit.disposeAndClear();
Control::dispose();
}
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 7ca80ef9456e..48ed13a2aefd 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -296,11 +296,11 @@ AnnotationWindow::~AnnotationWindow()
void AnnotationWindow::dispose()
{
- mpMeta.clear();
+ mpMeta.disposeAndClear();
delete mpOutlinerView;
delete mpOutliner;
- mpVScrollbar.clear();
- mpTextWindow.clear();
+ mpVScrollbar.disposeAndClear();
+ mpTextWindow.disposeAndClear();
FloatingWindow::dispose();
}
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index e65a8a52f068..2c6d1613b7e1 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -3080,10 +3080,9 @@ SfxHelpWindow_Impl::~SfxHelpWindow_Impl()
void SfxHelpWindow_Impl::dispose()
{
SaveConfig();
- pIndexWin.clear();
-
+ pIndexWin.disposeAndClear();
pTextWin->CloseFrame();
- pTextWin.clear();
+ pTextWin.disposeAndClear();
SplitWindow::dispose();
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 9b18e9937878..0122bbd9f88b 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -2142,11 +2142,11 @@ CustomPropertiesControl::~CustomPropertiesControl()
void CustomPropertiesControl::dispose()
{
- m_pVertScroll.clear();
- m_pPropertiesWin.clear();
- m_pBody.clear();
- m_pHeaderBar.clear();
- m_pVBox.clear();
+ m_pVertScroll.disposeAndClear();
+ m_pPropertiesWin.disposeAndClear();
+ m_pBody.disposeAndClear();
+ m_pHeaderBar.disposeAndClear();
+ m_pVBox.disposeAndClear();
vcl::Window::dispose();
}
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 5739784e8630..9dcccbcda03e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -80,40 +80,23 @@ Deck::~Deck()
void Deck::dispose()
{
- Dispose();
+ SharedPanelContainer aPanels;
+ aPanels.swap(maPanels);
// We have to explicitly trigger the destruction of panels.
// Otherwise that is done by one of our base class destructors
// without updating maPanels.
- for (size_t i = 0; i < maPanels.size(); i++)
- maPanels[i]->dispose();
-
+ for (size_t i = 0; i < aPanels.size(); i++)
+ aPanels[i].disposeAndClear();
maPanels.clear();
- vcl::Window::dispose();
-}
-
-void Deck::Dispose (void)
-{
- SharedPanelContainer aPanels;
- aPanels.swap(maPanels);
- for (SharedPanelContainer::iterator
- iPanel(aPanels.begin()),
- iEnd(aPanels.end());
- iPanel!=iEnd;
- ++iPanel)
- {
- if (*iPanel)
- {
- (*iPanel)->Dispose();
- iPanel->disposeAndClear();
- }
- }
mpTitleBar.disposeAndClear();
mpFiller.disposeAndClear();
mpVerticalScrollBar.disposeAndClear();
mpScrollContainer.disposeAndClear();
mpScrollClipWindow.disposeAndClear();
+
+ vcl::Window::dispose();
}
DeckTitleBar* Deck::GetTitleBar (void) const
diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx
index 6aaeabe69ed6..d4416ab89292 100644
--- a/sfx2/source/sidebar/Deck.hxx
+++ b/sfx2/source/sidebar/Deck.hxx
@@ -49,8 +49,6 @@ public:
virtual ~Deck (void);
virtual void dispose() SAL_OVERRIDE;
- void Dispose (void);
-
const ::rtl::OUString& GetId (void) const { return msId;}
DeckTitleBar* GetTitleBar (void) const;
Rectangle GetContentArea (void) const;
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 2f33b95a766d..8be4f2858142 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -76,12 +76,6 @@ Panel::~Panel()
void Panel::dispose()
{
- Dispose();
- vcl::Window::dispose();
-}
-
-void Panel::Dispose (void)
-{
mxPanelComponent = NULL;
{
@@ -98,6 +92,8 @@ void Panel::Dispose (void)
}
mpTitleBar.disposeAndClear();
+
+ vcl::Window::dispose();
}
PanelTitleBar* Panel::GetTitleBar (void) const
diff --git a/sfx2/source/sidebar/Panel.hxx b/sfx2/source/sidebar/Panel.hxx
index edacf7e93099..f72c88052cc1 100644
--- a/sfx2/source/sidebar/Panel.hxx
+++ b/sfx2/source/sidebar/Panel.hxx
@@ -49,8 +49,6 @@ public:
virtual ~Panel (void);
virtual void dispose() SAL_OVERRIDE;
- void Dispose (void);
-
PanelTitleBar* GetTitleBar (void) const;
bool IsTitleBarOptional (void) const { return mbIsTitleBarOptional;}
void SetUIElement (const css::uno::Reference<css::ui::XUIElement>& rxElement);
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index dd6655151f51..ee99a28d3ed2 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -203,9 +203,8 @@ void SAL_CALL SidebarController::disposing (void)
if (mpCurrentDeck)
{
- mpCurrentDeck->Dispose();
- mpCurrentDeck->PrintWindowTree();
mpCurrentDeck.disposeAndClear();
+// mpCurrentDeck->PrintWindowTree();
}
mpTabBar.disposeAndClear();
@@ -535,11 +534,7 @@ void SidebarController::SwitchToDeck (
{
// When the deck changes then destroy the deck and all panels
// and create everything new.
- if (mpCurrentDeck)
- {
- mpCurrentDeck->Dispose();
- mpCurrentDeck.disposeAndClear();
- }
+ mpCurrentDeck.disposeAndClear();
msCurrentDeckId = rDeckDescriptor.msId;
}
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index ed4522f306a7..5f9d022f620f 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -932,7 +932,7 @@ RecoveryDialog::~RecoveryDialog()
void RecoveryDialog::dispose()
{
- m_pFileListLB.clear();
+ m_pFileListLB.disposeAndClear();
m_pTitleFT.clear();
m_pDescrFT.clear();
m_pProgrParent.clear();
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index 0887b430ff1a..e795a49fa9c6 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -209,7 +209,7 @@ void FmFieldWin::dispose()
m_pChangeListener->release();
// delete m_pChangeListener;
}
- pListBox.clear();
+ pListBox.disposeAndClear();
delete pData;
SfxFloatingWindow::dispose();
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 8aea398c65cf..0d0fe95c16a5 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -561,8 +561,8 @@ ChineseDictionaryDialog::~ChineseDictionaryDialog()
void ChineseDictionaryDialog::dispose()
{
m_xContext=0;
- m_pCT_DictionaryToSimplified.clear();
- m_pCT_DictionaryToTraditional.clear();
+ m_pCT_DictionaryToSimplified.disposeAndClear();
+ m_pCT_DictionaryToTraditional.disposeAndClear();
m_pRB_To_Simplified.clear();
m_pRB_To_Traditional.clear();
m_pCB_Reverse.clear();
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 09cf2cf750f3..a99333ea85e4 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -334,7 +334,7 @@ void SwSendMailDialog::dispose()
}
}
delete m_pImpl;
- m_pStatus.clear();
+ m_pStatus.disposeAndClear();
m_pTransferStatus.clear();
m_pPaused.clear();
m_pProgressBar.clear();
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index b0552fff1e69..3acbad51932d 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -334,7 +334,10 @@ void ButtonDialog::RemoveButton( sal_uInt16 nId )
if (it->mnId == nId)
{
it->mpPushButton->Hide();
- it->mpPushButton.clear();
+ if (it->mbOwnButton)
+ it->mpPushButton.disposeAndClear();
+ else
+ it->mpPushButton.clear();
maItemList.erase(it);
return;
}
@@ -348,7 +351,8 @@ void ButtonDialog::Clear()
for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
it->mpPushButton->Hide();
- it->mpPushButton.disposeAndClear();
+ if (it->mbOwnButton)
+ it->mpPushButton.disposeAndClear();
}
maItemList.clear();
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 3bc1a633cda1..309a8b72d34c 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2036,7 +2036,6 @@ void MessageDialog::dispose()
m_pPrimaryMessage.disposeAndClear();
m_pSecondaryMessage.disposeAndClear();
- m_pSecondaryMessage.disposeAndClear();
m_pImage.disposeAndClear();
m_pGrid.disposeAndClear();
m_pOwnedActionArea.disposeAndClear();