diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-31 09:44:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-09 06:41:26 +0100 |
commit | 20831ee1c0c856904cdd4fae4a9a55ecc885d04d (patch) | |
tree | 90a93ac0d6c21fa60ffd395686cb5e69772fb186 /xmlhelp | |
parent | ee204f8f54de5bef526f2ad7fc78a425b196bb63 (diff) |
loplugin:useuniqueptr in ResultSetForQuery
Change-Id: Ie375f7fded2592cd1e926f14be0216608c2695d6
Reviewed-on: https://gerrit.libreoffice.org/63130
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx index 66ccaf747696..93007b70c6df 100644 --- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx +++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx @@ -128,7 +128,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte try { - vector< vector<HitItem>* > aQueryListResultVectorVector; + vector< vector<HitItem> > aQueryListResultVectorVector; set< OUString > aSet,aCurrent,aResultSet; int nQueryListSize = queryList.size(); @@ -140,8 +140,8 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte vector<HitItem>* pQueryResultVector; if( nQueryListSize > 1 ) { - pQueryResultVector = new vector<HitItem>; - aQueryListResultVectorVector.push_back( pQueryResultVector ); + aQueryListResultVectorVector.emplace_back(); + pQueryResultVector = &aQueryListResultVectorVector.back(); } else { @@ -197,8 +197,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte { for( int n = 0 ; n < nQueryListSize ; ++n ) { - vector<HitItem>* pQueryResultVector = aQueryListResultVectorVector[n]; - vector<HitItem>& rQueryResultVector = *pQueryResultVector; + vector<HitItem>& rQueryResultVector = aQueryListResultVectorVector[n]; int nItemCount = rQueryResultVector.size(); for( int i = 0 ; i < nItemCount ; ++i ) @@ -229,8 +228,6 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte } } } - - delete pQueryResultVector; } sort( aIndexFolderResultVector.begin(), aIndexFolderResultVector.end() ); |