diff options
Diffstat (limited to 'comphelper/source/misc')
-rw-r--r-- | comphelper/source/misc/accessibleeventnotifier.cxx | 19 | ||||
-rw-r--r-- | comphelper/source/misc/instancelocker.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/misc/instancelocker.hxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/listenernotification.cxx | 4 |
4 files changed, 13 insertions, 16 deletions
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx index 0d2cb848d34d..348fb555941a 100644 --- a/comphelper/source/misc/accessibleeventnotifier.cxx +++ b/comphelper/source/misc/accessibleeventnotifier.cxx @@ -20,7 +20,7 @@ #include <comphelper/accessibleeventnotifier.hxx> #include <osl/diagnose.h> #include <rtl/instance.hxx> -#include <cppuhelper/interfacecontainer.h> +#include <comphelper/interfacecontainer2.hxx> #include <comphelper/guarding.hxx> #include <map> @@ -37,7 +37,7 @@ namespace AccessibleEventObject > ClientEvent; typedef ::std::map< AccessibleEventNotifier::TClientId, - ::cppu::OInterfaceContainerHelper*, + ::comphelper::OInterfaceContainerHelper2*, ::std::less< AccessibleEventNotifier::TClientId > > ClientMap; /// key is the end of the interval, value is the start of the interval @@ -153,8 +153,8 @@ namespace comphelper TClientId nNewClientId = generateId( ); // the event listeners for the new client - ::cppu::OInterfaceContainerHelper *const pNewListeners = - new ::cppu::OInterfaceContainerHelper( lclMutex::get() ); + ::comphelper::OInterfaceContainerHelper2 *const pNewListeners = + new ::comphelper::OInterfaceContainerHelper2( lclMutex::get() ); // note that we're using our own mutex here, so the listener containers for all // our clients share this same mutex. // this is a reminiscence to the days where the notifier was asynchronous. Today this is @@ -187,7 +187,7 @@ namespace comphelper void AccessibleEventNotifier::revokeClientNotifyDisposing( const TClientId _nClient, const Reference< XInterface >& _rxEventSource ) { - ::cppu::OInterfaceContainerHelper* pListeners(nullptr); + ::comphelper::OInterfaceContainerHelper2* pListeners(nullptr); { // rhbz#1001768 drop the mutex before calling disposeAndClear @@ -255,7 +255,7 @@ namespace comphelper void AccessibleEventNotifier::addEvent( const TClientId _nClient, const AccessibleEventObject& _rEvent ) { - Sequence< Reference< XInterface > > aListeners; + std::vector< Reference< XInterface > > aListeners; // --- <mutex lock> ------------------------------- { @@ -272,20 +272,17 @@ namespace comphelper // --- </mutex lock> ------------------------------ // default handling: loop through all listeners, and notify them - const Reference< XInterface >* pListeners = aListeners.getConstArray(); - const Reference< XInterface >* pListenersEnd = pListeners + aListeners.getLength(); - while ( pListeners != pListenersEnd ) + for ( const auto& rListener : aListeners ) { try { - static_cast< XAccessibleEventListener* >( pListeners->get() )->notifyEvent( _rEvent ); + static_cast< XAccessibleEventListener* >( rListener.get() )->notifyEvent( _rEvent ); } catch( const Exception& ) { // no assertion, because a broken access remote bridge or something like this // can cause this exception } - ++pListeners; } } diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index 131efb7e2935..01937dd4c95b 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -104,7 +104,7 @@ void SAL_CALL OInstanceLocker::addEventListener( const uno::Reference< lang::XEv throw lang::DisposedException(); // TODO if ( !m_pListenersContainer ) - m_pListenersContainer = new ::cppu::OInterfaceContainerHelper( m_aMutex ); + m_pListenersContainer = new ::comphelper::OInterfaceContainerHelper2( m_aMutex ); m_pListenersContainer->addInterface( xListener ); } diff --git a/comphelper/source/misc/instancelocker.hxx b/comphelper/source/misc/instancelocker.hxx index de9064d280a9..3ac86e534715 100644 --- a/comphelper/source/misc/instancelocker.hxx +++ b/comphelper/source/misc/instancelocker.hxx @@ -31,7 +31,7 @@ #include <cppuhelper/weakref.hxx> #include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/interfacecontainer.h> +#include <comphelper/interfacecontainer2.hxx> class OLockListener; @@ -47,7 +47,7 @@ class OInstanceLocker : public ::cppu::WeakImplHelper< css::lang::XComponent, css::uno::Reference< css::uno::XInterface > m_xLockListener; OLockListener* m_pLockListener; - ::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners + ::comphelper::OInterfaceContainerHelper2* m_pListenersContainer; // list of listeners bool m_bDisposed; bool m_bInitialized; diff --git a/comphelper/source/misc/listenernotification.cxx b/comphelper/source/misc/listenernotification.cxx index 7dc4332ff43e..5c0c56de2458 100644 --- a/comphelper/source/misc/listenernotification.cxx +++ b/comphelper/source/misc/listenernotification.cxx @@ -48,7 +48,7 @@ namespace comphelper void OListenerContainer::impl_removeListener( const Reference< XEventListener >& _rxListener ) { #if OSL_DEBUG_LEVEL > 0 - ::cppu::OInterfaceIteratorHelper aIter( m_aListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners ); bool bFound = false; while ( aIter.hasMoreElements() && !bFound ) { @@ -74,7 +74,7 @@ namespace comphelper bool OListenerContainer::impl_notify( const EventObject& _rEvent ) { - ::cppu::OInterfaceIteratorHelper aIter( m_aListeners ); + ::comphelper::OInterfaceIteratorHelper2 aIter( m_aListeners ); bool bCancelled = false; while ( aIter.hasMoreElements() && !bCancelled ) { |