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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 18 08:36:01 UTC 2018


 sw/source/filter/ww8/ww8graf.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit ca35cd1136f30fa862ac24c6b3cf1c181450c3fa
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Sep 15 17:07:55 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Sep 18 10:35:39 2018 +0200

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

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 4f538c6eb565..9c9588b418e7 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -609,7 +609,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
     bool bDoingSymbol = false;
     sal_Unicode cReplaceSymbol = m_cSymbol;
 
-    SfxItemSet *pS = new SfxItemSet(m_pDrawEditEngine->GetEmptyItemSet());
+    std::unique_ptr<SfxItemSet> pS(new SfxItemSet(m_pDrawEditEngine->GetEmptyItemSet()));
     WW8PLCFManResult aRes;
 
     std::deque<Chunk> aChunks;
@@ -743,13 +743,12 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
             {
                 m_pDrawEditEngine->QuickSetAttribs( *pS,
                     GetESelection(*m_pDrawEditEngine, nTextStart - nStartCp, nEnd - nStartCp ) );
-                delete pS;
-                pS = new SfxItemSet(m_pDrawEditEngine->GetEmptyItemSet());
+                pS.reset( new SfxItemSet(m_pDrawEditEngine->GetEmptyItemSet()) );
             }
         }
         nStart = nNext;
     }
-    delete pS;
+    pS.reset();
 
     // pop off as far as recorded location just in case there were some left
     // unclosed


More information about the Libreoffice-commits mailing list