diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-05-16 11:12:48 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-06-29 07:25:22 +0000 |
commit | e57314f61f67b093510c5a8a8f34a62126ba8734 (patch) | |
tree | 7991c3a6f20c93b752628528196022474c6b4a7f /comphelper | |
parent | 371200675c2fb2fef0ac8362ebd7bf4203835440 (diff) |
return and use std::vector from OInterfaceContainerHelper
since most of the time we don’t need a heavyweight uno::Sequence.
Adds a new method getElementsAsVector().
Change-Id: I9e72bef0c0c723ffd0dd7d4152db5baec6784a7a
Reviewed-on: https://gerrit.libreoffice.org/15747
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/accessibleeventnotifier.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx index d8a3b36253e8..224c44de0c14 100644 --- a/comphelper/source/misc/accessibleeventnotifier.cxx +++ b/comphelper/source/misc/accessibleeventnotifier.cxx @@ -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> ------------------------------- { @@ -267,25 +267,22 @@ namespace comphelper return; // since we're synchronous, again, we want to notify immediately - aListeners = aClientPos->second->getElements(); + aListeners = aClientPos->second->getElementsAsVector(); } // --- </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 ) + // default handling: loop through all listeners, and notify them + for ( const Reference< XInterface > & rL : aListeners ) { try { - static_cast< XAccessibleEventListener* >( pListeners->get() )->notifyEvent( _rEvent ); + static_cast< XAccessibleEventListener* >( rL.get() )->notifyEvent( _rEvent ); } catch( const Exception& ) { // no assertion, because a broken access remote bridge or something like this // can cause this exception } - ++pListeners; } } |