diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-28 10:32:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-01 08:17:17 +0200 |
commit | 1cc24fe3be7221940c3bb6c4812d01a0f356f971 (patch) | |
tree | df394017a33f86a5a0de8570920e66133139a7c4 /ucb | |
parent | 30e0a64209f11ee596bcdd9eda1a320217ef31cd (diff) |
loplugin:useuniqueptr in gio::DataSupplier
Change-Id: Ie0633d26d858c25e355f49597352d6b29c8c6c0f
Reviewed-on: https://gerrit.libreoffice.org/61115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/gio/gio_datasupplier.cxx | 12 | ||||
-rw-r--r-- | ucb/source/ucp/gio/gio_datasupplier.hxx | 3 |
2 files changed, 3 insertions, 12 deletions
diff --git a/ucb/source/ucp/gio/gio_datasupplier.cxx b/ucb/source/ucp/gio/gio_datasupplier.cxx index d459ec12ff85..1d4acbdf3b42 100644 --- a/ucb/source/ucp/gio/gio_datasupplier.cxx +++ b/ucb/source/ucp/gio/gio_datasupplier.cxx @@ -35,8 +35,6 @@ using namespace gio; namespace gio { -typedef std::vector< ResultListEntry* > ResultList; - DataSupplier::DataSupplier( const rtl::Reference< ::gio::Content >& rContent, sal_Int32 nOpenMode ) : mxContent(rContent), mnOpenMode(nOpenMode), mbCountFinal(false) { @@ -73,7 +71,7 @@ bool DataSupplier::getData() break; } - maResults.push_back( new ResultListEntry( pInfo ) ); + maResults.emplace_back( new ResultListEntry( pInfo ) ); g_object_unref(pInfo); } @@ -85,14 +83,6 @@ bool DataSupplier::getData() DataSupplier::~DataSupplier() { - ResultList::const_iterator it = maResults.begin(); - ResultList::const_iterator end = maResults.end(); - - while ( it != end ) - { - delete *it; - ++it; - } } OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) diff --git a/ucb/source/ucp/gio/gio_datasupplier.hxx b/ucb/source/ucp/gio/gio_datasupplier.hxx index c2558d0e8f67..75fd66f35634 100644 --- a/ucb/source/ucp/gio/gio_datasupplier.hxx +++ b/ucb/source/ucp/gio/gio_datasupplier.hxx @@ -22,6 +22,7 @@ #include <ucbhelper/resultset.hxx> #include "gio_content.hxx" +#include <memory> #include <vector> namespace gio @@ -48,7 +49,7 @@ struct ResultListEntry } }; -typedef std::vector< ResultListEntry* > ResultList; +typedef std::vector< std::unique_ptr<ResultListEntry> > ResultList; class DataSupplier : public ucbhelper::ResultSetDataSupplier { |