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

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


 sw/source/ui/misc/num.cxx                        |    6 +++---
 sw/source/ui/misc/swmodalredlineacceptdlg.cxx    |    4 ++--
 sw/source/uibase/inc/num.hxx                     |    2 +-
 sw/source/uibase/inc/swmodalredlineacceptdlg.hxx |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 133a6a877ed48f1ef778a9ff387dda1f0dbcaa7f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 27 09:28:46 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:21:58 2018 +0200

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

diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
index 10a02b05cd9c..a3f336dc5a30 100644
--- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
+++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
@@ -43,7 +43,7 @@ SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(vcl::Window *pParent)
     : SfxModalDialog(pParent,
         "AcceptRejectChangesDialog", "svx/ui/acceptrejectchangesdialog.ui")
 {
-    pImplDlg = new SwRedlineAcceptDlg(this, this, get_content_area(), true);
+    pImplDlg.reset( new SwRedlineAcceptDlg(this, this, get_content_area(), true) );
 
     pImplDlg->Initialize(GetExtraData());
     pImplDlg->Activate();   // for data's initialisation
@@ -59,7 +59,7 @@ void SwModalRedlineAcceptDlg::dispose()
     AcceptAll(false);   // refuse everything remaining
     pImplDlg->FillInfo(GetExtraData());
 
-    delete pImplDlg;
+    pImplDlg.reset();
     SfxModalDialog::dispose();
 }
 
diff --git a/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx b/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
index ca64cf0ba40b..6fc6032c538e 100644
--- a/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
+++ b/sw/source/uibase/inc/swmodalredlineacceptdlg.hxx
@@ -25,7 +25,7 @@ class SwRedlineAcceptDlg;
 
 class SwModalRedlineAcceptDlg : public SfxModalDialog
 {
-    SwRedlineAcceptDlg*     pImplDlg;
+    std::unique_ptr<SwRedlineAcceptDlg> pImplDlg;
 
 public:
     SwModalRedlineAcceptDlg(vcl::Window *pParent);
commit c5adc20d4017d12172d861e7c1165e79c2ce93bf
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 27 09:25:42 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:21:49 2018 +0200

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

diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 69e0261c494f..89d748a826ef 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -141,7 +141,7 @@ SwNumPositionTabPage::~SwNumPositionTabPage()
 
 void SwNumPositionTabPage::dispose()
 {
-    delete pActNum;
+    pActNum.reset();
     pOutlineDlg = nullptr;
     SfxTabPage::dispose();
 }
@@ -434,10 +434,10 @@ void SwNumPositionTabPage::Reset( const SfxItemSet* rSet )
     }
 
     if(!pActNum)
-        pActNum = new  SwNumRule(*pSaveNum);
+        pActNum.reset(new  SwNumRule(*pSaveNum));
     else if(*pSaveNum != *pActNum)
         *pActNum = *pSaveNum;
-    m_aPreviewWIN.SetNumRule(pActNum);
+    m_aPreviewWIN.SetNumRule(pActNum.get());
     InitPosAndSpaceMode();
     ShowControlsDependingOnPosAndSpaceMode();
     InitControls();
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index d17a6894647e..f1849b17f2c5 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -37,7 +37,7 @@ class SwOutlineTabDialog;
 
 class SwNumPositionTabPage : public SfxTabPage
 {
-    SwNumRule*          pActNum;
+    std::unique_ptr<SwNumRule> pActNum;
     SwNumRule*          pSaveNum;
     SwWrtShell*         pWrtSh;
 


More information about the Libreoffice-commits mailing list