Kaydet (Commit) 1cc24fe3 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in gio::DataSupplier

Change-Id: Ie0633d26d858c25e355f49597352d6b29c8c6c0f
Reviewed-on: https://gerrit.libreoffice.org/61115
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 30e0a642
......@@ -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 )
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment