diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 14:43:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 14:43:59 +0200 |
commit | bfe999b81de0aa5f547251b263e82f8db3b8ac50 (patch) | |
tree | e7d3d25923f41ac9876c8717ac5de750c8cdc0b9 /sw | |
parent | b70fa47aec65fe95da94fc17640dda27650e9677 (diff) |
Use unique_ptr for SwRedlineItr::pSet
Change-Id: I6dc4cbfeb7413b4ce2ef7a588f4337f75eefd5af
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/text/redlnitr.hxx | 2 |
2 files changed, 4 insertions, 4 deletions
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; |