diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-10 14:41:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 08:59:24 +0200 |
commit | a13701cb6f0c01b1955b613d5d7507e47d4dbbfd (patch) | |
tree | 4d4acc2d3454a2fd010759cdb4854ef5861a9da0 | |
parent | 5928396cb2bb759fbbde68c1df50e1fa1ba07463 (diff) |
loplugin:useuniqueptr in SwDoc::GetUniqueTOXBaseName
Change-Id: I73851c8b630493980e58dad7d39da7c415517e77
Reviewed-on: https://gerrit.libreoffice.org/60348
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 274d3eebe2c6..4aeab823bac3 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -625,8 +625,8 @@ OUString SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, SwSectionFormats::size_type nNum = 0; const SwSectionFormats::size_type nFlagSize = ( mpSectionFormatTable->size() / 8 ) +2; - sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ]; - memset( pSetFlags, 0, nFlagSize ); + std::unique_ptr<sal_uInt8[]> pSetFlags(new sal_uInt8[ nFlagSize ]); + memset( pSetFlags.get(), 0, nFlagSize ); for( auto pSectionFormat : *mpSectionFormatTable ) { @@ -670,7 +670,6 @@ OUString SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, } } } - delete [] pSetFlags; if ( bUseChkStr ) return sChkStr; return aName + OUString::number( ++nNum ); |