diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-01 20:36:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-04 12:00:31 +0100 |
commit | a14b4e1d8a6ae8af24feb0e29b75d0e8996f974e (patch) | |
tree | b1432f280a5245aa4a0ba794c58969d69f1a9f22 /ucb | |
parent | ca05d480bd4456342f290f975a7353b7d9a63e95 (diff) |
use OMultiTypeInterfaceContainerHelperVar3 in SortedResultSet
Change-Id: I371dc8d97a4d6cb24c69e97b874bb50384df7526
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126337
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 25 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.hxx | 6 |
2 files changed, 10 insertions, 21 deletions
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index af13ca097047..1f28a308dc9b 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -28,7 +28,6 @@ #include <cppuhelper/implbase.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <comphelper/interfacecontainer2.hxx> -#include <comphelper/multiinterfacecontainer2.hxx> #include <cppuhelper/supportsservice.hxx> #include <tools/diagnose_ex.h> #include <memory> @@ -94,16 +93,6 @@ public: virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override; }; -typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> - PropertyChangeListenerContainer_Impl; - -class PropertyChangeListeners_Impl : public PropertyChangeListenerContainer_Impl -{ -public: - PropertyChangeListeners_Impl() - : PropertyChangeListenerContainer_Impl( getContainerMutex() ) {} -}; - SortedResultSet::SortedResultSet( Reference< XResultSet > const & aResult ) { @@ -819,7 +808,7 @@ void SAL_CALL SortedResultSet::addPropertyChangeListener( if ( !mpPropChangeListeners ) mpPropChangeListeners.reset( - new PropertyChangeListeners_Impl() ); + new comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertyChangeListener, OUString>(getContainerMutex()) ); mpPropChangeListeners->addInterface( PropertyName, Listener ); } @@ -844,7 +833,7 @@ void SAL_CALL SortedResultSet::addVetoableChangeListener( if ( !mpVetoChangeListeners ) mpVetoChangeListeners.reset( - new PropertyChangeListeners_Impl() ); + new comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XVetoableChangeListener, OUString>(getContainerMutex()) ); mpVetoChangeListeners->addInterface( PropertyName, Listener ); } @@ -1194,14 +1183,14 @@ void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt ) return; // Notify listeners interested especially in the changed property. - OInterfaceContainerHelper2* pPropsContainer = + OInterfaceContainerHelper3<XPropertyChangeListener>* pPropsContainer = mpPropChangeListeners->getContainer( rEvt.PropertyName ); if ( pPropsContainer ) { - OInterfaceIteratorHelper2 aIter( *pPropsContainer ); + OInterfaceIteratorHelper3 aIter( *pPropsContainer ); while ( aIter.hasMoreElements() ) { - static_cast< XPropertyChangeListener* >( aIter.next() )->propertyChange( rEvt ); + aIter.next()->propertyChange( rEvt ); } } @@ -1209,10 +1198,10 @@ void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt ) pPropsContainer = mpPropChangeListeners->getContainer( OUString() ); if ( pPropsContainer ) { - OInterfaceIteratorHelper2 aIter( *pPropsContainer ); + OInterfaceIteratorHelper3 aIter( *pPropsContainer ); while ( aIter.hasMoreElements() ) { - static_cast< XPropertyChangeListener* >( aIter.next() )->propertyChange( rEvt ); + aIter.next()->propertyChange( rEvt ); } } } diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index bcba14b6d63b..caf3d76e35fc 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -31,6 +31,7 @@ #include <com/sun/star/ucb/NumberedSortingInfo.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> #include <com/sun/star/ucb/ListAction.hpp> +#include <comphelper/multiinterfacecontainer3.hxx> #include <comphelper/interfacecontainer3.hxx> #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> @@ -41,7 +42,6 @@ struct SortInfo; struct SortListData; class SRSPropertySetInfo; -class PropertyChangeListeners_Impl; class SortedEntryList @@ -94,8 +94,8 @@ class SortedResultSet: public cppu::WeakImplHelper < css::beans::XPropertySet > { comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> *mpDisposeEventListeners; - std::unique_ptr<PropertyChangeListeners_Impl> mpPropChangeListeners; - std::unique_ptr<PropertyChangeListeners_Impl> mpVetoChangeListeners; + std::unique_ptr<comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertyChangeListener, OUString>> mpPropChangeListeners; + std::unique_ptr<comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XVetoableChangeListener, OUString>> mpVetoChangeListeners; css::uno::Reference < css::sdbc::XResultSet > mxOriginal; css::uno::Reference < css::sdbc::XResultSet > mxOther; |