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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 24 06:34:22 UTC 2018


 sw/inc/swmodule.hxx               |    2 +-
 sw/source/uibase/app/docstyle.cxx |    6 +++---
 sw/source/uibase/app/swmodule.cxx |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 232d0f4f6620bf21f382d38fd98f48ad57525ff0
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 23 12:07:19 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 24 08:34:10 2018 +0200

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

diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index cdb88dbf3569..8e23f8856d7b 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -91,7 +91,7 @@ class SW_DLLPUBLIC SwModule final : public SfxModule, public SfxListener, public
     SvtCTLOptions*      m_pCTLOptions;
     SvtUserOptions*     m_pUserOptions;
 
-    SfxErrorHandler*    m_pErrorHandler;
+    std::unique_ptr<SfxErrorHandler> m_pErrorHandler;
 
     SwAttrPool          *m_pAttrPool;
 
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 3d2744ddd2c6..14b800abfbe5 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -171,10 +171,10 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
 {
     SetName( "StarWriter" );
     SvxErrorHandler::ensure();
-    m_pErrorHandler = new SfxErrorHandler( RID_SW_ERRHDL,
+    m_pErrorHandler.reset( new SfxErrorHandler( RID_SW_ERRHDL,
                                      ErrCodeArea::Sw,
                                      ErrCodeArea::Sw,
-                                     GetResLocale() );
+                                     GetResLocale() ) );
 
     m_pModuleConfig = new SwModuleOptions;
 
@@ -225,7 +225,7 @@ SwModule::~SwModule()
 {
     css::uno::Sequence< css::uno::Any > aArgs;
     CallAutomationApplicationEventSinks( "Quit", aArgs );
-    delete m_pErrorHandler;
+    m_pErrorHandler.reset();
     EndListening( *SfxGetpApp() );
 }
 
commit 07d0c305187abeaa7661b0275725b29fe2e3623f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jul 23 11:18:43 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 24 08:33:57 2018 +0200

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

diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 0abb4e461d3e..260ad592eaa8 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -92,7 +92,7 @@ using namespace com::sun::star;
 class SwImplShellAction
 {
     SwWrtShell* pSh;
-    CurrShell* pCurrSh;
+    std::unique_ptr<CurrShell> pCurrSh;
 public:
     explicit SwImplShellAction( SwDoc& rDoc );
     ~SwImplShellAction() COVERITY_NOEXCEPT_FALSE;
@@ -110,7 +110,7 @@ SwImplShellAction::SwImplShellAction( SwDoc& rDoc )
 
     if( pSh )
     {
-        pCurrSh = new CurrShell( pSh );
+        pCurrSh.reset( new CurrShell( pSh ) );
         pSh->StartAllAction();
     }
 }
@@ -120,7 +120,7 @@ SwImplShellAction::~SwImplShellAction() COVERITY_NOEXCEPT_FALSE
     if( pCurrSh )
     {
         pSh->EndAllAction();
-        delete pCurrSh;
+        pCurrSh.reset();
     }
 }
 


More information about the Libreoffice-commits mailing list