diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-22 14:26:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-26 08:11:31 +0100 |
commit | 3cf85c9ff1975ed086eb9a390ea870d39313fed1 (patch) | |
tree | 4c11da2ae938dd0fa63a838dba54e76a14fe9682 /ucb/source | |
parent | b4155c305daf5c64b964bb2b8ea8d6bd672fd46b (diff) |
loplugin:useuniqueptr in PersistentPropertySet_Impl
Change-Id: I78259770767fd3bbe3217f20a513703e7347288f
Reviewed-on: https://gerrit.libreoffice.org/48587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/core/ucbstore.cxx | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 5e3fdfa90d53..62909dd6c692 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -1059,24 +1059,15 @@ struct PersistentPropertySet_Impl OUString m_aKey; OUString m_aFullKey; osl::Mutex m_aMutex; - OInterfaceContainerHelper2* m_pDisposeEventListeners; - OInterfaceContainerHelper2* m_pPropSetChangeListeners; - PropertyListeners_Impl* m_pPropertyChangeListeners; + std::unique_ptr<OInterfaceContainerHelper2> m_pDisposeEventListeners; + std::unique_ptr<OInterfaceContainerHelper2> m_pPropSetChangeListeners; + std::unique_ptr<PropertyListeners_Impl> m_pPropertyChangeListeners; PersistentPropertySet_Impl( PropertySetRegistry& rCreator, const OUString& rKey ) - : m_pCreator( &rCreator ), m_pInfo( nullptr ), m_aKey( rKey ), - m_pDisposeEventListeners( nullptr ), m_pPropSetChangeListeners( nullptr ), - m_pPropertyChangeListeners( nullptr ) + : m_pCreator( &rCreator ), m_pInfo( nullptr ), m_aKey( rKey ) { } - - ~PersistentPropertySet_Impl() - { - delete m_pDisposeEventListeners; - delete m_pPropSetChangeListeners; - delete m_pPropertyChangeListeners; - } }; @@ -1155,8 +1146,8 @@ void SAL_CALL PersistentPropertySet::addEventListener( const Reference< XEventListener >& Listener ) { if ( !m_pImpl->m_pDisposeEventListeners ) - m_pImpl->m_pDisposeEventListeners = - new OInterfaceContainerHelper2( m_pImpl->m_aMutex ); + m_pImpl->m_pDisposeEventListeners.reset( + new OInterfaceContainerHelper2( m_pImpl->m_aMutex ) ); m_pImpl->m_pDisposeEventListeners->addInterface( Listener ); } @@ -1329,8 +1320,8 @@ void SAL_CALL PersistentPropertySet::addPropertyChangeListener( // load(); if ( !m_pImpl->m_pPropertyChangeListeners ) - m_pImpl->m_pPropertyChangeListeners = - new PropertyListeners_Impl( m_pImpl->m_aMutex ); + m_pImpl->m_pPropertyChangeListeners.reset( + new PropertyListeners_Impl( m_pImpl->m_aMutex ) ); m_pImpl->m_pPropertyChangeListeners->addInterface( aPropertyName, xListener ); @@ -1724,8 +1715,8 @@ void SAL_CALL PersistentPropertySet::addPropertySetInfoChangeListener( const Reference< XPropertySetInfoChangeListener >& Listener ) { if ( !m_pImpl->m_pPropSetChangeListeners ) - m_pImpl->m_pPropSetChangeListeners = - new OInterfaceContainerHelper2( m_pImpl->m_aMutex ); + m_pImpl->m_pPropSetChangeListeners.reset( + new OInterfaceContainerHelper2( m_pImpl->m_aMutex ) ); m_pImpl->m_pPropSetChangeListeners->addInterface( Listener ); } |