diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-03 12:33:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-04 12:12:37 +0200 |
commit | 70b125c68eed7d99063f7599ea71b2831d2aed30 (patch) | |
tree | 2f5fdce79e9202c9af70abd6816dc46715ab09e7 /sw | |
parent | 9743bec6d81b19d38b69d8a52d969e90c6aef1b5 (diff) |
loplugin:useuniqueptr in HTMLControls
Change-Id: I7301fdb1dba6f05b43b114cfb72641958322964d
Reviewed-on: https://gerrit.libreoffice.org/61343
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlforw.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.hxx | 5 |
3 files changed, 3 insertions, 6 deletions
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 |