[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Xisco Fauli anistenis at gmail.com
Tue May 24 07:44:17 UTC 2016


 include/sfx2/tabdlg.hxx       |    4 ++--
 sfx2/source/dialog/tabdlg.cxx |    8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 7077c7aae78c63d48fa8ddd5b02eadb53db5d7c5
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun May 22 18:03:16 2016 +0200

    tdf#89329: use unique_ptr for pImpl in tabdlg
    
    Change-Id: Idf5d0d1f8b2dd68b1fe1a43e1fb1bf46837b58ec
    Reviewed-on: https://gerrit.libreoffice.org/25321
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index bf3a877..1b3b63c 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -80,7 +80,7 @@ friend class SfxTabDialogController;
 
     SfxItemSet*         m_pSet;
     SfxItemSet*         m_pOutSet;
-    TabDlg_Impl*        m_pImpl;
+    std::unique_ptr< TabDlg_Impl >        m_pImpl;
     sal_uInt16*         m_pRanges;
     sal_uInt16          m_nAppPageId;
     bool                m_bItemsReset;
@@ -209,7 +209,7 @@ private:
     const SfxItemSet*   pSet;
     OUString            aUserString;
     bool                bHasExchangeSupport;
-    TabPageImpl*        pImpl;
+    std::unique_ptr< TabPageImpl >        pImpl;
 
 protected:
     SfxTabPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet *rAttrSet);
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9515435..3d88b49 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -174,8 +174,7 @@ SfxTabPage::~SfxTabPage()
 
 void SfxTabPage::dispose()
 {
-    delete pImpl;
-    pImpl = nullptr;
+    pImpl.reset();
     TabPage::dispose();
 }
 
@@ -370,8 +369,7 @@ void SfxTabDialog::dispose()
         pDataObject = nullptr;
     }
 
-    delete m_pImpl;
-    m_pImpl = nullptr;
+    m_pImpl.reset();
     delete m_pSet;
     m_pSet = nullptr;
     delete m_pOutSet;
@@ -415,7 +413,7 @@ void SfxTabDialog::Init_Impl(bool bFmtFlag)
     assert(m_pBox);
     m_pUIBuilder->get(m_pTabCtrl, "tabcontrol");
 
-    m_pImpl = new TabDlg_Impl(m_pTabCtrl->GetPageCount());
+    m_pImpl.reset( new TabDlg_Impl(m_pTabCtrl->GetPageCount()) );
 
     m_pActionArea = get_action_area();
     assert(m_pActionArea);


More information about the Libreoffice-commits mailing list