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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 16 12:48:49 UTC 2018


 sw/inc/unosrch.hxx                 |    5 +++--
 sw/source/core/unocore/unosrch.cxx |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit d22cc61705239d9fcf6ee9597da8c883e3c79da4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 13 11:33:20 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 16 14:48:28 2018 +0200

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

diff --git a/sw/inc/unosrch.hxx b/sw/inc/unosrch.hxx
index bc2f3e0c7e51..2822f6439cfb 100644
--- a/sw/inc/unosrch.hxx
+++ b/sw/inc/unosrch.hxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <cppuhelper/implbase.hxx>
 #include <rtl/ustring.hxx>
+#include <memory>
 
 class SfxItemPropertySet;
 class SwSearchProperties_Impl;
@@ -45,8 +46,8 @@ class SwXTextSearch : public cppu::WeakImplHelper
     OUString                m_sSearchText;
     OUString                m_sReplaceText;
 
-    SwSearchProperties_Impl*    m_pSearchProperties;
-    SwSearchProperties_Impl*    m_pReplaceProperties;
+    std::unique_ptr<SwSearchProperties_Impl> m_pSearchProperties;
+    std::unique_ptr<SwSearchProperties_Impl> m_pReplaceProperties;
 
     const SfxItemPropertySet*   m_pPropSet;
     bool                    m_bAll  : 1;
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 429201ac4d7c..69f473051a03 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -488,8 +488,8 @@ SwXTextSearch::SwXTextSearch() :
 
 SwXTextSearch::~SwXTextSearch()
 {
-    delete m_pSearchProperties;
-    delete m_pReplaceProperties;
+    m_pSearchProperties.reset();
+    m_pReplaceProperties.reset();
 }
 
 namespace


More information about the Libreoffice-commits mailing list