dbaccess/source/core/dataaccess/ContentHelper.cxx | 12 ++++++------ dbaccess/source/core/dataaccess/intercept.cxx | 6 +++--- dbaccess/source/core/dataaccess/intercept.hxx | 4 +++- dbaccess/source/core/inc/ContentHelper.hxx | 4 ++-- dbaccess/source/core/inc/definitioncontainer.hxx | 1 + 5 files changed, 15 insertions(+), 12 deletions(-)
New commits: commit 8ef60f89bae290d8c38acacfc792b32176f9afa9 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Dec 1 18:43:54 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Dec 3 10:30:03 2021 +0100 use OMultiTypeInterfaceContainerHelperVar3 in OContentHelper Change-Id: I04e8c5fd38618689ad148ba6fbe823971881cbb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126194 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index bbf910cbf641..beb75c3d40dd 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -503,14 +503,14 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent return; // First, notify listeners interested in changes of every property. - comphelper::OInterfaceContainerHelper2* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() ); + comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() ); if ( pAllPropsContainer ) { - comphelper::OInterfaceIteratorHelper2 aIter( *pAllPropsContainer ); + comphelper::OInterfaceIteratorHelper3 aIter( *pAllPropsContainer ); while ( aIter.hasMoreElements() ) { // Propagate event. - static_cast< XPropertiesChangeListener* >( aIter.next() )->propertiesChange( evt ); + aIter.next()->propertiesChange( evt ); } } @@ -524,15 +524,15 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent const PropertyChangeEvent& rEvent = *propertyChangeEvent; const OUString& rName = rEvent.PropertyName; - comphelper::OInterfaceContainerHelper2* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName ); + comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pPropsContainer = m_aPropertyChangeListeners.getContainer( rName ); if ( pPropsContainer ) { - comphelper::OInterfaceIteratorHelper2 aIter( *pPropsContainer ); + comphelper::OInterfaceIteratorHelper3 aIter( *pPropsContainer ); while ( aIter.hasMoreElements() ) { Sequence< PropertyChangeEvent >* propertyEvents; - XPropertiesChangeListener* pListener = static_cast< XPropertiesChangeListener * >( aIter.next() ); + XPropertiesChangeListener* pListener = aIter.next().get(); PropertiesEventListenerMap::iterator it = aListeners.find( pListener ); if ( it == aListeners.end() ) { diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx index 3e7f309976f9..6ca2bf4c70b5 100644 --- a/dbaccess/source/core/dataaccess/intercept.cxx +++ b/dbaccess/source/core/dataaccess/intercept.cxx @@ -208,7 +208,7 @@ void SAL_CALL OInterceptor::addStatusListener( { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) ); + m_pStatCL.reset( new StatusListenerContainer(m_aMutex) ); } m_pStatCL->addInterface(URL.Complete,Control); @@ -225,7 +225,7 @@ void SAL_CALL OInterceptor::addStatusListener( { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) ); + m_pStatCL.reset( new StatusListenerContainer(m_aMutex) ); } m_pStatCL->addInterface(URL.Complete,Control); @@ -249,7 +249,7 @@ void SAL_CALL OInterceptor::addStatusListener( { osl::MutexGuard aGuard(m_aMutex); if(!m_pStatCL) - m_pStatCL.reset( new PropertyChangeListenerContainer(m_aMutex) ); + m_pStatCL.reset( new StatusListenerContainer(m_aMutex) ); } m_pStatCL->addInterface(URL.Complete,Control); diff --git a/dbaccess/source/core/dataaccess/intercept.hxx b/dbaccess/source/core/dataaccess/intercept.hxx index 16077c3c9e52..7ce53752f19d 100644 --- a/dbaccess/source/core/dataaccess/intercept.hxx +++ b/dbaccess/source/core/dataaccess/intercept.hxx @@ -103,7 +103,9 @@ private: css::uno::Sequence< OUString > m_aInterceptedURL; - std::unique_ptr<PropertyChangeListenerContainer> m_pStatCL; + typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::frame::XStatusListener, OUString> + StatusListenerContainer; + std::unique_ptr<StatusListenerContainer> m_pStatCL; }; } // namespace dbaccess diff --git a/dbaccess/source/core/inc/ContentHelper.hxx b/dbaccess/source/core/inc/ContentHelper.hxx index 471729982b9d..5168f1307824 100644 --- a/dbaccess/source/core/inc/ContentHelper.hxx +++ b/dbaccess/source/core/inc/ContentHelper.hxx @@ -30,7 +30,7 @@ #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> #include <comphelper/interfacecontainer3.hxx> -#include <comphelper/multiinterfacecontainer2.hxx> +#include <comphelper/multiinterfacecontainer3.hxx> #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/sdbcx/XRename.hpp> @@ -72,7 +72,7 @@ namespace dbaccess typedef std::shared_ptr<OContentHelper_Impl> TContentPtr; - typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> + typedef comphelper::OMultiTypeInterfaceContainerHelperVar3<css::beans::XPropertiesChangeListener, OUString> PropertyChangeListenerContainer; typedef ::cppu::WeakComponentImplHelper< css::ucb::XContent , css::ucb::XCommandProcessor diff --git a/dbaccess/source/core/inc/definitioncontainer.hxx b/dbaccess/source/core/inc/definitioncontainer.hxx index bcb6bd364470..9c871601ad6f 100644 --- a/dbaccess/source/core/inc/definitioncontainer.hxx +++ b/dbaccess/source/core/inc/definitioncontainer.hxx @@ -36,6 +36,7 @@ #include "ContentHelper.hxx" #include "containerapprove.hxx" #include <comphelper/uno3.hxx> +#include <comphelper/interfacecontainer2.hxx> namespace dbaccess {