diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-21 20:32:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-22 07:55:24 +0100 |
commit | 9b0ea78959f6bcbc1a776c505352ab37e91381ad (patch) | |
tree | 9d4d4a6e92ede6803fda89b47b1b4bef4204e20e /ucbhelper/source/provider | |
parent | b67257c5dc54b37495a755005192e4cf186aef25 (diff) |
use more OInterfaceContainerHelper3 in ContentImplHelper_Impl
Change-Id: Id4e4fca8a5a4e2d050752e666a843e7d8661ec0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125635
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucbhelper/source/provider')
-rw-r--r-- | ucbhelper/source/provider/contenthelper.cxx | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx index 2c64dc1968a6..4cf93d1207b9 100644 --- a/ucbhelper/source/provider/contenthelper.cxx +++ b/ucbhelper/source/provider/contenthelper.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyExistException.hpp> #include <com/sun/star/beans/PropertySetInfoChange.hpp> +#include <comphelper/interfacecontainer3.hxx> #include <cppuhelper/interfacecontainer.hxx> #include <cppuhelper/supportsservice.hxx> #include <cppuhelper/queryinterface.hxx> @@ -108,8 +109,10 @@ struct ContentImplHelper_Impl rtl::Reference< ::ucbhelper::PropertySetInfo > m_xPropSetInfo; rtl::Reference< ::ucbhelper::CommandProcessorInfo > m_xCommandsInfo; std::unique_ptr<cppu::OInterfaceContainerHelper> m_pDisposeEventListeners; - std::unique_ptr<cppu::OInterfaceContainerHelper> m_pContentEventListeners; - std::unique_ptr<cppu::OInterfaceContainerHelper> m_pPropSetChangeListeners; + std::unique_ptr<comphelper::OInterfaceContainerHelper3<css::ucb::XContentEventListener>> + m_pContentEventListeners; + std::unique_ptr<comphelper::OInterfaceContainerHelper3<beans::XPropertySetInfoChangeListener>> + m_pPropSetChangeListeners; std::unique_ptr<cppu::OInterfaceContainerHelper> m_pCommandChangeListeners; std::unique_ptr<PropertyChangeListeners> m_pPropertyChangeListeners; }; @@ -270,7 +273,7 @@ void SAL_CALL ContentImplHelper::addContentEventListener( if ( !m_pImpl->m_pContentEventListeners ) m_pImpl->m_pContentEventListeners.reset( - new cppu::OInterfaceContainerHelper( m_aMutex )); + new comphelper::OInterfaceContainerHelper3<css::ucb::XContentEventListener>( m_aMutex )); m_pImpl->m_pContentEventListeners->addInterface( Listener ); } @@ -563,7 +566,7 @@ void SAL_CALL ContentImplHelper::addPropertySetInfoChangeListener( if ( !m_pImpl->m_pPropSetChangeListeners ) m_pImpl->m_pPropSetChangeListeners.reset( - new cppu::OInterfaceContainerHelper( m_aMutex )); + new comphelper::OInterfaceContainerHelper3<beans::XPropertySetInfoChangeListener>( m_aMutex )); m_pImpl->m_pPropSetChangeListeners->addInterface( Listener ); } @@ -721,15 +724,9 @@ void ContentImplHelper::notifyPropertySetInfoChange( return; // Notify event listeners. - cppu::OInterfaceIteratorHelper aIter( *m_pImpl->m_pPropSetChangeListeners ); + comphelper::OInterfaceIteratorHelper3 aIter( *m_pImpl->m_pPropSetChangeListeners ); while ( aIter.hasMoreElements() ) - { - // Propagate event. - uno::Reference< beans::XPropertySetInfoChangeListener > - xListener( aIter.next(), uno::UNO_QUERY ); - if ( xListener.is() ) - xListener->propertySetInfoChange( evt ); - } + aIter.next()->propertySetInfoChange( evt ); } void ContentImplHelper::notifyContentEvent( @@ -739,16 +736,9 @@ void ContentImplHelper::notifyContentEvent( return; // Notify event listeners. - cppu::OInterfaceIteratorHelper aIter( *m_pImpl->m_pContentEventListeners ); + comphelper::OInterfaceIteratorHelper3 aIter( *m_pImpl->m_pContentEventListeners ); while ( aIter.hasMoreElements() ) - { - // Propagate event. - uno::Reference< - css::ucb::XContentEventListener > xListener( - aIter.next(), uno::UNO_QUERY ); - if ( xListener.is() ) - xListener->contentEvent( evt ); - } + aIter.next()->contentEvent( evt ); } void ContentImplHelper::inserted() |