[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Tue Feb 20 09:23:32 UTC 2018


 sw/source/core/fields/authfld.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 665e646c3b217e93c8e0649a4fa4326340163483
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Feb 19 11:27:07 2018 +0100

    sw: convert DELETEZ to unique_ptr in authfld.cxx
    
    Change-Id: Ic37556a95b31308a7f88a1074c2c1cba30d47cd0
    Reviewed-on: https://gerrit.libreoffice.org/49988
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

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());
                 }
             }
         }


More information about the Libreoffice-commits mailing list