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

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


 sw/source/ui/chrdlg/chardlg.cxx         |    4 ++--
 sw/source/ui/config/mailconfigpage.cxx  |    2 +-
 sw/source/ui/dialog/macassgn.cxx        |    4 ++--
 sw/source/uibase/inc/chrdlg.hxx         |    2 +-
 sw/source/uibase/inc/macassgn.hxx       |    2 +-
 sw/source/uibase/inc/mailconfigpage.hxx |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit cecb480b91688567f5f0f91568ceecd53835f46a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 26 15:08:26 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:19:09 2018 +0200

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

diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 1038a54c6358..b7752e853e7d 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -137,7 +137,7 @@ SwMailConfigPage::~SwMailConfigPage()
 
 void SwMailConfigPage::dispose()
 {
-    delete m_pConfigItem;
+    m_pConfigItem.reset();
     m_pDisplayNameED.clear();
     m_pAddressED.clear();
     m_pReplyToCB.clear();
diff --git a/sw/source/uibase/inc/mailconfigpage.hxx b/sw/source/uibase/inc/mailconfigpage.hxx
index 85466b507282..697bebb26827 100644
--- a/sw/source/uibase/inc/mailconfigpage.hxx
+++ b/sw/source/uibase/inc/mailconfigpage.hxx
@@ -48,7 +48,7 @@ class SwMailConfigPage : public SfxTabPage
     VclPtr<PushButton>      m_pServerAuthenticationPB;
     VclPtr<PushButton>      m_pTestPB;
 
-    SwMailMergeConfigItem*  m_pConfigItem;
+    std::unique_ptr<SwMailMergeConfigItem>  m_pConfigItem;
 
     DECL_LINK(ReplyToHdl, Button*, void);
     DECL_LINK(AuthenticationHdl, Button*, void);
commit df7adbfc158f182e9111ade5cde45fc860f0275e
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 26 14:35:03 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:19:02 2018 +0200

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

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index ce27eae7dcfa..716d88528121 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -185,7 +185,7 @@ SwCharURLPage::~SwCharURLPage()
 
 void SwCharURLPage::dispose()
 {
-    delete pINetItem;
+    pINetItem.reset();
     SfxTabPage::dispose();
 }
 
@@ -221,7 +221,7 @@ void SwCharURLPage::Reset(const SfxItemSet* rSet)
         m_xVisitedLB->save_value();
         m_xNotVisitedLB->save_value();
         m_xTargetFrameLB->save_value();
-        pINetItem = new SvxMacroItem(FN_INET_FIELD_MACRO);
+        pINetItem.reset( new SvxMacroItem(FN_INET_FIELD_MACRO) );
 
         if( pINetFormat->GetMacroTable() )
             pINetItem->SetMacroTable(*pINetFormat->GetMacroTable());
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 7b192f89c2cb..ec1c51062a99 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -105,13 +105,13 @@ SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType )
 }
 
 bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
-                                    SvxMacroItem*& rpINetItem )
+                                    std::unique_ptr<SvxMacroItem>& rpINetItem )
 {
     bool bRet = false;
     SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>{} );
     SvxMacroItem aItem( RES_FRMMACRO );
     if( !rpINetItem )
-        rpINetItem = new SvxMacroItem( RES_FRMMACRO );
+        rpINetItem.reset(new SvxMacroItem( RES_FRMMACRO ));
     else
         aItem.SetMacroTable( rpINetItem->GetMacroTable() );
 
diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx
index 10d00c645105..0f8ec43d9296 100644
--- a/sw/source/uibase/inc/chrdlg.hxx
+++ b/sw/source/uibase/inc/chrdlg.hxx
@@ -55,7 +55,7 @@ public:
 
 class SwCharURLPage : public SfxTabPage
 {
-    SvxMacroItem*       pINetItem;
+    std::unique_ptr<SvxMacroItem> pINetItem;
     bool                bModified;
 
     std::unique_ptr<weld::Entry> m_xURLED;
diff --git a/sw/source/uibase/inc/macassgn.hxx b/sw/source/uibase/inc/macassgn.hxx
index 1bb1800c295d..7437f094c9d2 100644
--- a/sw/source/uibase/inc/macassgn.hxx
+++ b/sw/source/uibase/inc/macassgn.hxx
@@ -39,7 +39,7 @@ class SwMacroAssignDlg
 public:
     static SfxEventNamesItem AddEvents( DlgEventType eType );
     static bool INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh,
-                            SvxMacroItem*& rpINetItem );
+                            std::unique_ptr<SvxMacroItem>& rpINetItem );
 };
 
 #endif


More information about the Libreoffice-commits mailing list