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

Stephan Bergmann sbergman at redhat.com
Wed Jun 14 12:44:26 UTC 2017


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

New commits:
commit bfe999b81de0aa5f547251b263e82f8db3b8ac50
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 14 14:43:59 2017 +0200

    Use unique_ptr for SwRedlineItr::pSet
    
    Change-Id: I6dc4cbfeb7413b4ce2ef7a588f4337f75eefd5af

diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index d5b5edc77e95..b0aaeb31bf8d 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "hintids.hxx"
+#include <o3tl/make_unique.hxx>
 #include <svl/whiter.hxx>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <swmodule.hxx>
@@ -165,7 +166,7 @@ SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
                             SwAttrHandler& rAH, sal_Int32 nRed, bool bShw,
                             const std::vector<ExtTextInputAttr> *pArr,
                             sal_Int32 nExtStart )
-    : rDoc( *rTextNd.GetDoc() ), rAttrHandler( rAH ), pSet( nullptr ),
+    : rDoc( *rTextNd.GetDoc() ), rAttrHandler( rAH ),
       nNdIdx( rTextNd.GetIndex() ), nFirst( nRed ),
       nAct( COMPLETE_STRING ), bOn( false ), bShow( bShw )
 {
@@ -179,7 +180,6 @@ SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
 SwRedlineItr::~SwRedlineItr()
 {
     Clear( nullptr );
-    delete pSet;
     delete pExt;
 }
 
@@ -236,7 +236,7 @@ short SwRedlineItr::Seek_(SwFont& rFnt, sal_Int32 nNew, sal_Int32 nOld)
                     {
                         SwAttrPool& rPool =
                             const_cast<SwDoc&>(rDoc).GetAttrPool();
-                        pSet = new SfxItemSet(rPool, RES_CHRATR_BEGIN, RES_CHRATR_END-1);
+                        pSet = o3tl::make_unique<SfxItemSet>(rPool, RES_CHRATR_BEGIN, RES_CHRATR_END-1);
                     }
 
                     if( 1 < pRed->GetStackCount() )
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index b7665e64427c..5aef747246da 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -62,7 +62,7 @@ class SwRedlineItr
     std::deque<SwTextAttr *> m_Hints;
     const SwDoc& rDoc;
     SwAttrHandler& rAttrHandler;
-    SfxItemSet *pSet;
+    std::unique_ptr<SfxItemSet> pSet;
     SwExtend *pExt;
     sal_uLong nNdIdx;
     sal_Int32 nFirst;


More information about the Libreoffice-commits mailing list