diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 18:44:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-14 18:44:26 +0200 |
commit | 0646f3ef7cd036b899f7b8ef3a897eecb298994c (patch) | |
tree | 5cb6493dfcc35570c57d1a19884ca6e28cf2a906 /sw | |
parent | 2618b4013e5acfcc6d9564da36bb24151a8b8280 (diff) |
Use unique_ptr for HTMLAttrContext::pFrameItemSet
Change-Id: I90d0461be7b9df1200bc3eef6ae1d6dbb20f7c5b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlctxt.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.hxx | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 423f2b670155..c575f209e6bb 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -18,6 +18,7 @@ */ #include "hintids.hxx" +#include <o3tl/make_unique.hxx> #include <svl/itemiter.hxx> #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> @@ -702,9 +703,9 @@ void SwHTMLParser::SplitPREListingXMP( HTMLAttrContext *pCntxt ) SfxItemSet *HTMLAttrContext::GetFrameItemSet( SwDoc *pCreateDoc ) { if( !pFrameItemSet && pCreateDoc ) - pFrameItemSet = new SfxItemSet( pCreateDoc->GetAttrPool(), + pFrameItemSet = o3tl::make_unique<SfxItemSet>( pCreateDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - return pFrameItemSet; + return pFrameItemSet.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index a1ef95e54d8c..d38ff1ffeb15 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -201,7 +201,7 @@ class HTMLAttrContext OUString aClass; // context class HTMLAttrContext_SaveDoc *pSaveDocContext; - SfxItemSet *pFrameItemSet; + std::unique_ptr<SfxItemSet> pFrameItemSet; HtmlTokenId nToken; // the token of the context @@ -233,7 +233,6 @@ public: bool bDfltColl=false ) : aClass( rClass ), pSaveDocContext( nullptr ), - pFrameItemSet( nullptr ), nToken( nTokn ), nTextFormatColl( nPoolId ), nLeftMargin( 0 ), @@ -255,7 +254,6 @@ public: explicit HTMLAttrContext( HtmlTokenId nTokn ) : pSaveDocContext( nullptr ), - pFrameItemSet( nullptr ), nToken( nTokn ), nTextFormatColl( 0 ), nLeftMargin( 0 ), @@ -275,7 +273,7 @@ public: bRestartListing( false ) {} - ~HTMLAttrContext() { ClearSaveDocContext(); delete pFrameItemSet; } + ~HTMLAttrContext() { ClearSaveDocContext(); } HtmlTokenId GetToken() const { return nToken; } @@ -307,7 +305,7 @@ public: bool HasSaveDocContext() const { return pSaveDocContext!=nullptr; } HTMLAttrContext_SaveDoc *GetSaveDocContext( bool bCreate=false ); - const SfxItemSet *GetFrameItemSet() const { return pFrameItemSet; } + const SfxItemSet *GetFrameItemSet() const { return pFrameItemSet.get(); } SfxItemSet *GetFrameItemSet( SwDoc *pCreateDoc ); void SetFinishPREListingXMP( bool bSet ) { bFinishPREListingXMP = bSet; } |