diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-28 11:24:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-01 08:17:49 +0200 |
commit | df9e895763d7887baef7fe14c035aff25b99be7e (patch) | |
tree | 1cb249a9d24e4160b8d8ad1219e2438315d19633 /ucb/source | |
parent | 11e8e629037a8b80470f3f7c2bb96bd74e4ead0b (diff) |
loplugin:useuniqueptr in hierarchy_ucp::DataSupplier_Impl
Change-Id: I56259038649419b5ef02d911c20358d8a8d56917
Reviewed-on: https://gerrit.libreoffice.org/61118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx index f7d9a8daec73..13e6eea30ead 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx @@ -57,7 +57,7 @@ struct ResultListEntry // ResultList. -typedef std::vector< ResultListEntry* > ResultList; +typedef std::vector< std::unique_ptr<ResultListEntry> > ResultList; // struct DataSupplier_Impl. @@ -84,22 +84,9 @@ struct DataSupplier_Impl rContent->getProvider().get() ), rContent->getIdentifier()->getContentIdentifier() ), m_nOpenMode( nOpenMode ), m_bCountFinal( false ) {} - ~DataSupplier_Impl(); }; -DataSupplier_Impl::~DataSupplier_Impl() -{ - ResultList::const_iterator it = m_aResults.begin(); - ResultList::const_iterator end = m_aResults.end(); - - while ( it != end ) - { - delete *it; - ++it; - } -} - } @@ -247,7 +234,7 @@ bool HierarchyResultSetDataSupplier::getResult( sal_uInt32 nIndex ) const HierarchyEntryData& rResult = *m_pImpl->m_aIterator; if ( checkResult( rResult ) ) { - m_pImpl->m_aResults.push_back( new ResultListEntry( rResult ) ); + m_pImpl->m_aResults.emplace_back( new ResultListEntry( rResult ) ); if ( nPos == nIndex ) { @@ -294,7 +281,7 @@ sal_uInt32 HierarchyResultSetDataSupplier::totalCount() { const HierarchyEntryData& rResult = *m_pImpl->m_aIterator; if ( checkResult( rResult ) ) - m_pImpl->m_aResults.push_back( new ResultListEntry( rResult ) ); + m_pImpl->m_aResults.emplace_back( new ResultListEntry( rResult ) ); } m_pImpl->m_bCountFinal = true; |