diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-20 14:01:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-21 12:11:40 +0200 |
commit | 06e2159f3448e9ce00fd521aadd32075ae93f376 (patch) | |
tree | 2e75749a87d691377a8d4e4e9c3897d2a959d5d0 /ucb | |
parent | 5ff6bfeafb9c14d2f0fff4464b970dff11de537b (diff) |
loplugin:useuniqueptr in PropertyChangeNotifier
Change-Id: Ibfbee5d4c9378778ee4a8d70ee1501444f071003
Reviewed-on: https://gerrit.libreoffice.org/59360
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/file/bc.cxx | 5 | ||||
-rw-r--r-- | ucb/source/ucp/file/filnot.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/file/filnot.hxx | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index b457bc87140f..f42cdf84fd76 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -1260,7 +1260,7 @@ BaseContent::cPCL() if( length ) { - ListenerMap* listener = new ListenerMap; + std::unique_ptr<ListenerMap> listener(new ListenerMap); for( sal_Int32 i = 0; i < length; ++i ) { cppu::OInterfaceContainerHelper* pContainer = m_pPropertyListener->getContainer(seqNames[i]); @@ -1269,8 +1269,7 @@ BaseContent::cPCL() (*listener)[seqNames[i]] = pContainer->getElements(); } - p.reset( new PropertyChangeNotifier( this, - listener ) ); + p.reset( new PropertyChangeNotifier( this, std::move(listener) ) ); } return p; diff --git a/ucb/source/ucp/file/filnot.cxx b/ucb/source/ucp/file/filnot.cxx index de5168617d19..c63dae89dcf6 100644 --- a/ucb/source/ucp/file/filnot.cxx +++ b/ucb/source/ucp/file/filnot.cxx @@ -197,9 +197,9 @@ PropertySetInfoChangeNotifier::notifyPropertyRemoved( const OUString & aProperty PropertyChangeNotifier::PropertyChangeNotifier( const css::uno::Reference< XContent >& xCreatorContent, - ListenerMap* pListeners ) + std::unique_ptr<ListenerMap> pListeners ) : m_xCreatorContent( xCreatorContent ), - m_pListeners( pListeners ) + m_pListeners( std::move(pListeners) ) { } diff --git a/ucb/source/ucp/file/filnot.hxx b/ucb/source/ucp/file/filnot.hxx index daf69d662ada..98f0b8983f0b 100644 --- a/ucb/source/ucp/file/filnot.hxx +++ b/ucb/source/ucp/file/filnot.hxx @@ -88,7 +88,7 @@ namespace fileaccess { public: PropertyChangeNotifier( const css::uno::Reference< css::ucb::XContent >& xCreatorContent, - ListenerMap* pListeners ); + std::unique_ptr<ListenerMap> pListeners ); ~PropertyChangeNotifier(); |