diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-19 16:35:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-25 12:02:47 +0200 |
commit | 88e26267844ac96f39d341ef05bd1536f210af74 (patch) | |
tree | e6865bb8af40bb2849f24900c91e219ce4667b89 /ucb | |
parent | 5c829a7df3768254324bbdcc36b7fd79983fafbe (diff) |
loplugin:useuniqueptr in cmis::DataSupplier
Change-Id: If12889ffe320c6a2e2808709ce53438e92077a58
Reviewed-on: https://gerrit.libreoffice.org/60958
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_datasupplier.cxx | 16 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_datasupplier.hxx | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/ucb/source/ucp/cmis/cmis_datasupplier.cxx b/ucb/source/ucp/cmis/cmis_datasupplier.cxx index 01819ad36a03..42c5c10157d2 100644 --- a/ucb/source/ucp/cmis/cmis_datasupplier.cxx +++ b/ucb/source/ucp/cmis/cmis_datasupplier.cxx @@ -47,7 +47,7 @@ namespace cmis ( mnOpenMode == ucb::OpenMode::DOCUMENTS && !bIsFolder ) || ( mnOpenMode == ucb::OpenMode::ALL ) ) { - maResults.push_back( new ResultListEntry( *it ) ); + maResults.emplace_back( *it ); } } mbCountFinal = true; @@ -55,12 +55,6 @@ namespace cmis DataSupplier::~DataSupplier() { - while ( maResults.size( ) > 0 ) - { - ResultListEntry* back = maResults.back( ); - maResults.pop_back( ); - delete back; - } } OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) @@ -80,7 +74,7 @@ namespace cmis if (!getResult(nIndex)) return uno::Reference<ucb::XContent>(); - return maResults[ nIndex ]->xContent; + return maResults[ nIndex ].xContent; } bool DataSupplier::getResult( sal_uInt32 nIndex ) @@ -115,7 +109,7 @@ namespace cmis { if ( nIndex < maResults.size() ) { - uno::Reference< sdbc::XRow > xRow = maResults[ nIndex ]->xRow; + uno::Reference< sdbc::XRow > xRow = maResults[ nIndex ].xRow; if ( xRow.is() ) { // Already cached. @@ -142,7 +136,7 @@ namespace cmis uno::Reference< sdbc::XRow > xRow; if ( aResult >>= xRow ) { - maResults[ nIndex ]->xRow = xRow; + maResults[ nIndex ].xRow = xRow; return xRow; } } @@ -157,7 +151,7 @@ namespace cmis void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) { if ( nIndex < maResults.size() ) - maResults[ nIndex ]->xRow.clear(); + maResults[ nIndex ].xRow.clear(); } void DataSupplier::close() diff --git a/ucb/source/ucp/cmis/cmis_datasupplier.hxx b/ucb/source/ucp/cmis/cmis_datasupplier.hxx index 0f618f04bc54..f7cad8774dc4 100644 --- a/ucb/source/ucp/cmis/cmis_datasupplier.hxx +++ b/ucb/source/ucp/cmis/cmis_datasupplier.hxx @@ -31,8 +31,6 @@ namespace cmis } }; - typedef std::vector< ResultListEntry* > ResultList; - class DataSupplier : public ucbhelper::ResultSetDataSupplier { private: @@ -40,7 +38,7 @@ namespace cmis sal_Int32 mnOpenMode; bool mbCountFinal; void getData(); - ResultList maResults; + std::vector< ResultListEntry > maResults; public: DataSupplier( ChildrenProvider* pChildrenProvider, sal_Int32 nOpenMode ); |