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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 4 10:13:01 UTC 2018


 sw/source/filter/html/htmlforw.cxx |    2 +-
 sw/source/filter/html/wrthtml.cxx  |    2 +-
 sw/source/filter/html/wrthtml.hxx  |    5 +----
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 70b125c68eed7d99063f7599ea71b2831d2aed30
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Oct 3 12:33:25 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Oct 4 12:12:37 2018 +0200

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

diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 97636e64efff..85db134bf892 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -1310,7 +1310,7 @@ static void AddControl( HTMLControls& rControls,
         std::unique_ptr<HTMLControl> pHCntrl(new HTMLControl( xFormComps, nNodeIdx ));
         HTMLControls::const_iterator it = rControls.find( pHCntrl.get() );
         if( it == rControls.end() )
-            rControls.insert( pHCntrl.release() );
+            rControls.insert( std::move(pHCntrl) );
         else
         {
             if( (*it)->xFormComps==xFormComps )
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 0d14929ca0c3..1095aa60d681 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -486,7 +486,7 @@ ErrCode SwHTMLWriter::WriteStream()
         m_pHTMLPosFlyFrames.reset();
     }
 
-    m_aHTMLControls.DeleteAndDestroyAll();
+    m_aHTMLControls.clear();
 
     m_CharFormatInfos.clear();
     m_TextCollInfos.clear();
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 279ed3ba04c5..e06c4190aa4d 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -200,10 +200,7 @@ struct HTMLControl
     }
 };
 
-class HTMLControls : public o3tl::sorted_vector<HTMLControl*, o3tl::less_ptr_to<HTMLControl> > {
-public:
-    // will free any items still in the vector
-    ~HTMLControls() { DeleteAndDestroyAll(); }
+class HTMLControls : public o3tl::sorted_vector<std::unique_ptr<HTMLControl>, o3tl::less_uniqueptr_to<HTMLControl> > {
 };
 
 struct SwHTMLFormatInfo


More information about the Libreoffice-commits mailing list