diff options
Diffstat (limited to 'UnoControls/source/base/multiplexer.cxx')
-rw-r--r-- | UnoControls/source/base/multiplexer.cxx | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/UnoControls/source/base/multiplexer.cxx b/UnoControls/source/base/multiplexer.cxx index 2e0f48dd75fb..0f0f34b68660 100644 --- a/UnoControls/source/base/multiplexer.cxx +++ b/UnoControls/source/base/multiplexer.cxx @@ -38,31 +38,28 @@ namespace unocontrols { #define MULTIPLEX( INTERFACE, METHOD, EVENTTYP, EVENT ) \ \ /* First get all interfaces from container with right type.*/ \ - OInterfaceContainerHelper* pContainer = m_aListenerHolder.getContainer( cppu::UnoType<INTERFACE>::get() ); \ + comphelper::OInterfaceContainerHelper2* pContainer = m_aListenerHolder.getContainer( cppu::UnoType<INTERFACE>::get() ); \ /* Do the follow only, if elements in container exist.*/ \ - if( pContainer != nullptr ) \ - { \ - OInterfaceIteratorHelper aIterator( *pContainer ); \ - EVENTTYP aLocalEvent = EVENT; \ - /* Remark: The control is the event source not the peer.*/ \ - /* We must change the source of the event. */ \ - aLocalEvent.Source = m_xControl; \ - /* Is the control not destroyed? */ \ - if( aLocalEvent.Source.is() ) \ - { \ - if( aIterator.hasMoreElements() ) \ - { \ - INTERFACE * pListener = static_cast<INTERFACE *>(aIterator.next()); \ - try \ - { \ - pListener->METHOD( aLocalEvent ); \ - } \ - catch(const RuntimeException& ) \ - { \ - /* Ignore all system exceptions from the listener! */ \ - } \ - } \ - } \ + if( !pContainer ) \ + return; \ + comphelper::OInterfaceIteratorHelper2 aIterator( *pContainer ); \ + EVENTTYP aLocalEvent = EVENT; \ + /* Remark: The control is the event source not the peer.*/ \ + /* We must change the source of the event. */ \ + aLocalEvent.Source = m_xControl; \ + /* Is the control not destroyed? */ \ + if( !aLocalEvent.Source ) \ + return; \ + if( !aIterator.hasMoreElements() ) \ + return; \ + INTERFACE * pListener = static_cast<INTERFACE *>(aIterator.next()); \ + try \ + { \ + pListener->METHOD( aLocalEvent ); \ + } \ + catch(const RuntimeException& ) \ + { \ + /* Ignore all system exceptions from the listener! */ \ } // construct/destruct @@ -100,7 +97,7 @@ Any SAL_CALL OMRCListenerMultiplexerHelper::queryInterface( const Type& rType ) // Don't use mutex or guard in this method!!! Is a method of XInterface. // Ask for my own supported interfaces ... - // Attention: XTypeProvider and XInterface are supported by OComponentHelper! + // Attention: XTypeProvider and XInterface are supported by WeakComponentImplHelper! Any aReturn ( ::cppu::queryInterface( rType , static_cast< XWindowListener* > ( this ) , static_cast< XKeyListener* > ( this ) , @@ -128,7 +125,7 @@ Any SAL_CALL OMRCListenerMultiplexerHelper::queryInterface( const Type& rType ) // XInterface -void SAL_CALL OMRCListenerMultiplexerHelper::acquire() throw() +void SAL_CALL OMRCListenerMultiplexerHelper::acquire() noexcept { // Attention: // Don't use mutex or guard in this method!!! Is a method of XInterface. @@ -139,7 +136,7 @@ void SAL_CALL OMRCListenerMultiplexerHelper::acquire() throw() // XInterface -void SAL_CALL OMRCListenerMultiplexerHelper::release() throw() +void SAL_CALL OMRCListenerMultiplexerHelper::release() noexcept { // Attention: // Don't use mutex or guard in this method!!! Is a method of XInterface. @@ -159,7 +156,7 @@ void OMRCListenerMultiplexerHelper::setPeer( const Reference< XWindow >& xPeer ) if( m_xPeer.is() ) { // get all types from the listener added to the peer - const Sequence< Type > aContainedTypes = m_aListenerHolder.getContainedTypes(); + const std::vector< Type > aContainedTypes = m_aListenerHolder.getContainedTypes(); // loop over all listener types and remove the listeners from the peer for( const auto& rContainedType : aContainedTypes ) impl_unadviseFromPeer( m_xPeer, rContainedType ); @@ -168,7 +165,7 @@ void OMRCListenerMultiplexerHelper::setPeer( const Reference< XWindow >& xPeer ) if( m_xPeer.is() ) { // get all types from the listener added to the peer - const Sequence< Type > aContainedTypes = m_aListenerHolder.getContainedTypes(); + const std::vector< Type > aContainedTypes = m_aListenerHolder.getContainedTypes(); // loop over all listener types and add the listeners to the peer for( const auto& rContainedType : aContainedTypes ) impl_adviseToPeer( m_xPeer, rContainedType ); |