diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 10:26:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-13 08:30:53 +0200 |
commit | 43125f3b0b18b8d9bac9bd459fa234cb5ff9ddb4 (patch) | |
tree | d3f8b83b7080e358d926db8fcb711100996cee89 | |
parent | 4b4a6d43a8cff2bc335f813d5c300bad14a9ba6e (diff) |
loplugin:useuniqueptr in SwDoc::GetUniqueSectionName
Change-Id: I24365f9412c6086d143ebb1769c1f792109a958c
Reviewed-on: https://gerrit.libreoffice.org/60409
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 5e671ec72366..c64f7a0ab410 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -1363,8 +1363,8 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const 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 pFormat : *mpSectionFormatTable ) { @@ -1404,7 +1404,7 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const } } } - delete [] pSetFlags; + pSetFlags.reset(); if( pChkStr ) return *pChkStr; return aName + OUString::number( ++nNum ); |