diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-16 12:24:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-17 08:39:28 +0200 |
commit | 4c9423b3e033a4eabf76b3bffb344385e770a4b6 (patch) | |
tree | fdc01d1daa85d30321b37d8d078271c633625d51 | |
parent | e77428ae3143166cfd96a6df1262e358c17f4695 (diff) |
loplugin:useuniqueptr in SwRelNumRuleSpaces
Change-Id: I0f5ab46d117114b4d90f15252a7ea7fa01dab039
Reviewed-on: https://gerrit.libreoffice.org/57518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/filter/basflt/fltini.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/inc/fltini.hxx | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 64f607331d69..57427cde8e42 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -283,7 +283,7 @@ void StgReader::SetFltName( const OUString& rFltNm ) SwRelNumRuleSpaces::SwRelNumRuleSpaces( SwDoc const & rDoc, bool bNDoc ) { - pNumRuleTable = new SwNumRuleTable; + pNumRuleTable.reset(new SwNumRuleTable); pNumRuleTable->reserve(8); if( !bNDoc ) pNumRuleTable->insert( pNumRuleTable->begin(), @@ -293,10 +293,7 @@ SwRelNumRuleSpaces::SwRelNumRuleSpaces( SwDoc const & rDoc, bool bNDoc ) SwRelNumRuleSpaces::~SwRelNumRuleSpaces() { if( pNumRuleTable ) - { pNumRuleTable->clear(); - delete pNumRuleTable; - } } void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx index 70cafaa46e94..ca3f9e347e7f 100644 --- a/sw/source/filter/inc/fltini.hxx +++ b/sw/source/filter/inc/fltini.hxx @@ -64,7 +64,7 @@ void GetWW8Writer( const OUString&, const OUString&, WriterRef& ); // of the NumRule must be subtracted from the paragraph indentation. class SW_DLLPUBLIC SwRelNumRuleSpaces { - SwNumRuleTable* pNumRuleTable; // list of all named NumRules + std::unique_ptr<SwNumRuleTable> pNumRuleTable; // list of all named NumRules public: SwRelNumRuleSpaces( SwDoc const & rDoc, bool bNewDoc ); |