diff options
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 { |