[Libreoffice-commits] core.git: 2 commits - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 30 06:23:07 UTC 2018


 sw/source/ui/dbui/mmlayoutpage.cxx  |    6 +++---
 sw/source/ui/dbui/mmlayoutpage.hxx  |    2 +-
 sw/source/ui/index/cnttab.cxx       |    4 ++--
 sw/source/uibase/inc/swuicnttab.hxx |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 077b746be045a3918a55f21a687ba47dcb77702e
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 27 09:27:36 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:22:53 2018 +0200

    loplugin:useuniqueptr in SwTOXStylesTabPage
    
    Change-Id: I566ac5f9c334cfdfe879cdb0eef921fcc9a7be8d
    Reviewed-on: https://gerrit.libreoffice.org/58243
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 5680a394e160..a791bf0d341d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3649,7 +3649,7 @@ SwTOXStylesTabPage::~SwTOXStylesTabPage()
 
 void SwTOXStylesTabPage::dispose()
 {
-    delete m_pCurrentForm;
+    m_pCurrentForm.reset();
     m_pLevelLB.clear();
     m_pAssignBT.clear();
     m_pParaLayLB.clear();
@@ -3670,7 +3670,7 @@ void SwTOXStylesTabPage::Reset( const SfxItemSet* rSet )
 
 void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
 {
-    m_pCurrentForm = new SwForm(GetForm());
+    m_pCurrentForm.reset(new SwForm(GetForm()));
     m_pParaLayLB->Clear();
     m_pLevelLB->Clear();
 
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 522a0a1298c4..32bbdec0c218 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -453,7 +453,7 @@ class SwTOXStylesTabPage : public SfxTabPage
     VclPtr<PushButton>     m_pStdBT;
     VclPtr<PushButton>     m_pEditStyleBT;
 
-    SwForm*         m_pCurrentForm;
+    std::unique_ptr<SwForm> m_pCurrentForm;
 
     DECL_LINK( EditStyleHdl, Button *, void );
     DECL_LINK( StdHdl, Button*, void );
commit 7234541a7832c03ebd617a93d080e6cf8628a138
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 27 09:39:38 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:22:45 2018 +0200

    loplugin:useuniqueptr in SwMailMergeLayoutPage
    
    Change-Id: Ia8411b8efa792fe06f25765a2aa4d479c66f1ec5
    Reviewed-on: https://gerrit.libreoffice.org/58249
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 4fb050c0096d..23e6d7b845a2 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -123,8 +123,8 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
     xStore->storeToURL( m_sExampleURL, aValues   );
 
     Link<SwOneExampleFrame&,void> aLink(LINK(this, SwMailMergeLayoutPage, PreviewLoadedHdl_Impl));
-    m_pExampleFrame = new SwOneExampleFrame( *m_pExampleContainerWIN,
-                                    EX_SHOW_DEFAULT_PAGE, &aLink, &m_sExampleURL );
+    m_pExampleFrame.reset( new SwOneExampleFrame( *m_pExampleContainerWIN,
+                                    EX_SHOW_DEFAULT_PAGE, &aLink, &m_sExampleURL ) );
 
     m_pExampleContainerWIN->Show(false);
 
@@ -165,7 +165,7 @@ SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
 
 void SwMailMergeLayoutPage::dispose()
 {
-    delete m_pExampleFrame;
+    m_pExampleFrame.reset();
     File::remove( m_sExampleURL );
     m_pPosition.clear();
     m_pAlignToBodyCB.clear();
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index c2e453fbab57..56be9e26f996 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -52,7 +52,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
 
     VclPtr<ListBox>            m_pZoomLB;
 
-    SwOneExampleFrame*  m_pExampleFrame;
+    std::unique_ptr<SwOneExampleFrame> m_pExampleFrame;
     SwWrtShell*         m_pExampleWrtShell;
 
     OUString            m_sExampleURL;


More information about the Libreoffice-commits mailing list