diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-23 08:56:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-26 08:11:51 +0100 |
commit | 47ae2add3a818dff6c85c5a4376772b542258484 (patch) | |
tree | e3667bb9f7b394e06ce05e3b12477a4b4bf586e1 | |
parent | 3cf85c9ff1975ed086eb9a390ea870d39313fed1 (diff) |
loplugin:useuniqueptr in SortedResultSet
Change-Id: Ib57cf4b30afda6f5e0d024a0c72417f6b1786e9a
Reviewed-on: https://gerrit.libreoffice.org/48588
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 11 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.hxx | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 4041fdcb806e..e18360794bf4 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -141,9 +141,6 @@ SortedResultSet::~SortedResultSet() mpSortInfo = nullptr; mpPropSetInfo.clear(); - - delete mpPropChangeListeners; - delete mpVetoChangeListeners; } @@ -823,8 +820,8 @@ void SAL_CALL SortedResultSet::addPropertyChangeListener( osl::Guard< osl::Mutex > aGuard( maMutex ); if ( !mpPropChangeListeners ) - mpPropChangeListeners = - new PropertyChangeListeners_Impl(); + mpPropChangeListeners.reset( + new PropertyChangeListeners_Impl() ); mpPropChangeListeners->addInterface( PropertyName, Listener ); } @@ -848,8 +845,8 @@ void SAL_CALL SortedResultSet::addVetoableChangeListener( osl::Guard< osl::Mutex > aGuard( maMutex ); if ( !mpVetoChangeListeners ) - mpVetoChangeListeners = - new PropertyChangeListeners_Impl(); + mpVetoChangeListeners.reset( + new PropertyChangeListeners_Impl() ); mpVetoChangeListeners->addInterface( PropertyName, Listener ); } diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index 649a5c957e5d..f97f9050c6bc 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -37,6 +37,7 @@ #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> #include <deque> +#include <memory> namespace comphelper { class OInterfaceContainerHelper2; @@ -99,8 +100,8 @@ class SortedResultSet: public cppu::WeakImplHelper < css::beans::XPropertySet > { comphelper::OInterfaceContainerHelper2 *mpDisposeEventListeners; - PropertyChangeListeners_Impl *mpPropChangeListeners; - PropertyChangeListeners_Impl *mpVetoChangeListeners; + std::unique_ptr<PropertyChangeListeners_Impl> mpPropChangeListeners; + std::unique_ptr<PropertyChangeListeners_Impl> mpVetoChangeListeners; css::uno::Reference < css::sdbc::XResultSet > mxOriginal; css::uno::Reference < css::sdbc::XResultSet > mxOther; |