diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-02-19 11:27:07 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-02-20 10:23:11 +0100 |
commit | 665e646c3b217e93c8e0649a4fa4326340163483 (patch) | |
tree | bcd1a76fe05f99bcd3ac82a9d0896c24b7edec4c /sw | |
parent | 713ac313c1f053cc5d812843a3b5611f7d1a10e5 (diff) |
sw: convert DELETEZ to unique_ptr in authfld.cxx
Change-Id: Ic37556a95b31308a7f88a1074c2c1cba30d47cd0
Reviewed-on: https://gerrit.libreoffice.org/49988
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/fields/authfld.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 35a94a6dfb8b..4c6803e2b1c2 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -272,8 +272,8 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle) pTextNode->getLayoutFrame( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ) && pTextNode->GetNodes().IsDocNodes() ) { - SwTOXAuthority* pNew = new SwTOXAuthority( *pTextNode, - *pFormatField, aIntl ); + std::unique_ptr<SwTOXAuthority> pNew( + new SwTOXAuthority(*pTextNode, *pFormatField, aIntl)); for(SwTOXSortTabBases::size_type i = 0; i < aSortArr.size(); ++i) { @@ -283,7 +283,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle) //only the first occurrence in the document //has to be in the array if(*pOld < *pNew) - DELETEZ(pNew); + pNew.reset(); else // remove the old content { aSortArr.erase(aSortArr.begin() + i); @@ -304,7 +304,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle) break; ++j; } - aSortArr.insert(aSortArr.begin() + j, pNew); + aSortArr.insert(aSortArr.begin() + j, pNew.release()); } } } |