[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 2 commits - avmedia/source basctl/source cui/source dbaccess/source formula/source sd/source sfx2/source svtools/source svx/source sw/source vcl/source

Michael Meeks michael.meeks at collabora.com
Mon Apr 13 07:43:59 PDT 2015


 avmedia/source/framework/mediacontrol.cxx                             |    2 
 basctl/source/basicide/baside2b.cxx                                   |    2 
 basctl/source/basicide/basidesh.cxx                                   |    2 
 cui/source/customize/cfg.cxx                                          |    8 +-
 cui/source/dialogs/cuigaldlg.cxx                                      |    4 -
 cui/source/tabpages/autocdlg.cxx                                      |    6 +-
 dbaccess/source/ui/misc/WTypeSelect.cxx                               |    2 
 dbaccess/source/ui/querydesign/JoinTableView.cxx                      |    8 +-
 dbaccess/source/ui/querydesign/QueryTableView.cxx                     |    2 
 formula/source/ui/dlg/funcutl.cxx                                     |    2 
 sd/source/ui/annotations/annotationwindow.cxx                         |    6 +-
 sfx2/source/appl/newhelp.cxx                                          |    5 -
 sfx2/source/dialog/dinfdlg.cxx                                        |   10 +--
 sfx2/source/sidebar/Deck.cxx                                          |   29 ++--------
 sfx2/source/sidebar/Deck.hxx                                          |    2 
 sfx2/source/sidebar/Panel.cxx                                         |    8 --
 sfx2/source/sidebar/Panel.hxx                                         |    2 
 sfx2/source/sidebar/SidebarController.cxx                             |    9 ---
 sfx2/source/toolbox/tbxitem.cxx                                       |    2 
 svtools/source/dialogs/wizardmachine.cxx                              |    2 
 svtools/source/uno/popupwindowcontroller.cxx                          |    2 
 svx/source/dialog/docrecovery.cxx                                     |    2 
 svx/source/form/tabwin.cxx                                            |    2 
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |    4 -
 sw/source/ui/dbui/mmoutputtypepage.cxx                                |    5 -
 sw/source/uibase/utlui/navipi.cxx                                     |    3 -
 vcl/source/window/btndlg.cxx                                          |    8 ++
 vcl/source/window/builder.cxx                                         |    2 
 vcl/source/window/layout.cxx                                          |    1 
 29 files changed, 55 insertions(+), 87 deletions(-)

New commits:
commit 5245021a806ccdd0d569d5cee7b95167892e9aab
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon Apr 13 15:39:37 2015 +0100

    Explicit disposeOnce instead of transient wrappers.
    
    Change-Id: I578aa360c9923abd3fc516865896a004f377375b
    audit: "vclwidget: check for calling delete on subclasses of vcl::Window"

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

    More lifecycle correction.
    
       Another (complete) audit of delete usage in:
            "vclwidget: change all vcl::window fields to be wrapped in VclPtr"
    
    Change-Id: I828212ded66ecc5cc30c75a4de626c7b386cb77a

diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index baf1acf..e6c680e 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 e7784af..076aa3e 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 248c765..89a79b7 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 0d8b428..b74c37e 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 cf9bc11..5f9643b 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 c6747f9..716dc88 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 7ca80ef..48ed13a 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 e65a8a5..2c6d161 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 9b18e99..0122bbd 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 5739784..9dcccbc 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 6aaeabe..d4416ab 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 2f33b95..8be4f28 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 edacf7e..f72c880 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 dd66551..ee99a28 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 ed4522f..5f9d022 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 0887b43..e795a49 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 8aea398..0d0fe95 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 09cf2cf..a99333e 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 b0552ff..3acbad5 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 3bc1a63..309a8b7 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();


More information about the Libreoffice-commits mailing list