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

Noel Grandin noel.grandin at collabora.co.uk
Thu Jul 12 06:31:50 UTC 2018


 sw/source/core/text/redlnitr.cxx |    6 +++---
 sw/source/core/text/redlnitr.hxx |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b1a15e7f5b5680b33bd25956479dc30209a79078
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jul 11 14:34:24 2018 +0200

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

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index fa0673bc80e5..0d2a39f5fdad 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -314,8 +314,8 @@ SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
     if( pArr )
     {
         assert(pExtInputStart);
-        m_pExt = new SwExtend(*pArr, pExtInputStart->nNode.GetIndex(),
-                                     pExtInputStart->nContent.GetIndex());
+        m_pExt.reset( new SwExtend(*pArr, pExtInputStart->nNode.GetIndex(),
+                                     pExtInputStart->nContent.GetIndex()) );
     }
     else
         m_pExt = nullptr;
@@ -326,7 +326,7 @@ SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
 SwRedlineItr::~SwRedlineItr() COVERITY_NOEXCEPT_FALSE
 {
     Clear( nullptr );
-    delete m_pExt;
+    m_pExt.reset();
 }
 
 // The return value of SwRedlineItr::Seek tells you if the current font
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index f683eb86c846..55a5f4a8c862 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -73,7 +73,7 @@ class SwRedlineItr
     const SwDoc& m_rDoc;
     SwAttrHandler& m_rAttrHandler;
     std::unique_ptr<SfxItemSet> m_pSet;
-    SwExtend *m_pExt;
+    std::unique_ptr<SwExtend> m_pExt;
     // note: this isn't actually used in the merged-para (Hide) case
     sal_uLong const m_nNdIdx;
     SwRedlineTable::size_type const m_nFirst;


More information about the Libreoffice-commits mailing list