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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 12 08:11:50 UTC 2018


 sw/source/core/crsr/findattr.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit b22e3d3b631efdb3f25066ecbecedbe3507fbb43
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 10 14:40:36 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 12 10:11:25 2018 +0200

    loplugin:useuniqueptr in SwAttrCheckArr
    
    Change-Id: If981fc6f64b28812e1face263da326c7a424487a
    Reviewed-on: https://gerrit.libreoffice.org/60345
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index d2d35f229f08..452064e866b8 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -350,7 +350,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTextAttr& rAttr )
     const SfxPoolItem* pItem;
     // here we explicitly also search in character templates
     sal_uInt16 nWhch = rAttr.Which();
-    SfxWhichIter* pIter = nullptr;
+    std::unique_ptr<SfxWhichIter> pIter;
     const SfxPoolItem* pTmpItem = nullptr;
     const SfxItemSet* pSet = nullptr;
     if( RES_TXTATR_CHARFMT == nWhch || RES_TXTATR_AUTOFMT == nWhch )
@@ -361,7 +361,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTextAttr& rAttr )
         pSet = CharFormat::GetItemSet( rAttr.GetAttr() );
         if ( pSet )
         {
-            pIter = new SfxWhichIter( *pSet );
+            pIter.reset(new SfxWhichIter( *pSet ));
             nWhch = pIter->FirstWhich();
             while( nWhch &&
                 SfxItemState::SET != pSet->GetItemState( nWhch, true, &pTmpItem ) )
@@ -486,7 +486,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTextAttr& rAttr )
         else
             break;
     }
-    delete pIter;
+    pIter.reset();
     return Found();
 }
 
@@ -503,7 +503,7 @@ bool SwAttrCheckArr::SetAttrBwd( const SwTextAttr& rAttr )
     const SfxPoolItem* pItem;
     // here we explicitly also search in character templates
     sal_uInt16 nWhch = rAttr.Which();
-    SfxWhichIter* pIter = nullptr;
+    std::unique_ptr<SfxWhichIter> pIter;
     const SfxPoolItem* pTmpItem = nullptr;
     const SfxItemSet* pSet = nullptr;
     if( RES_TXTATR_CHARFMT == nWhch || RES_TXTATR_AUTOFMT == nWhch )
@@ -514,7 +514,7 @@ bool SwAttrCheckArr::SetAttrBwd( const SwTextAttr& rAttr )
         pSet = CharFormat::GetItemSet( rAttr.GetAttr() );
         if ( pSet )
         {
-            pIter = new SfxWhichIter( *pSet );
+            pIter.reset( new SfxWhichIter( *pSet ) );
             nWhch = pIter->FirstWhich();
             while( nWhch &&
                 SfxItemState::SET != pSet->GetItemState( nWhch, true, &pTmpItem ) )
@@ -637,7 +637,7 @@ bool SwAttrCheckArr::SetAttrBwd( const SwTextAttr& rAttr )
         else
             break;
     }
-    delete pIter;
+    pIter.reset();
     return Found();
 }
 


More information about the Libreoffice-commits mailing list