From cd888e4c04d209a8d436906369c13d6206c176f4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Dec 2021 19:07:50 +0200 Subject: use OMultiTypeInterfaceContainerHelperVar3 in SbaXVetoableChangeMultiplexer Change-Id: I60088bdf046659ca94a2aa9c09a3091e2dd03945 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126196 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/source/ui/browser/sbamultiplex.cxx | 14 +++++++------- dbaccess/source/ui/inc/sbamultiplex.hxx | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx index 76a625d47069..48e907221b39 100644 --- a/dbaccess/source/ui/browser/sbamultiplex.cxx +++ b/dbaccess/source/ui/browser/sbamultiplex.cxx @@ -464,7 +464,7 @@ void SAL_CALL SbaXVetoableChangeMultiplexer::disposing(const css::lang::EventObj } void SAL_CALL SbaXVetoableChangeMultiplexer::vetoableChange(const css::beans::PropertyChangeEvent& e) { - ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(e.PropertyName); + ::comphelper::OInterfaceContainerHelper3* pListeners = m_aListeners.getContainer(e.PropertyName); if (pListeners) Notify(*pListeners, e); @@ -475,13 +475,13 @@ void SAL_CALL SbaXVetoableChangeMultiplexer::vetoableChange(const css::beans::Pr } void SbaXVetoableChangeMultiplexer::addInterface(const OUString& rName, - const css::uno::Reference< css::uno::XInterface > & rListener) + const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener) { m_aListeners.addInterface(rName, rListener); } void SbaXVetoableChangeMultiplexer::removeInterface(const OUString& rName, - const css::uno::Reference< css::uno::XInterface > & rListener) + const css::uno::Reference< css::beans::XVetoableChangeListener > & rListener) { m_aListeners.removeInterface(rName, rListener); } @@ -498,7 +498,7 @@ sal_Int32 SbaXVetoableChangeMultiplexer::getOverallLen() const const std::vector< OUString > aContained = m_aListeners.getContainedTypes(); for ( OUString const & s : aContained) { - ::comphelper::OInterfaceContainerHelper2* pListeners = m_aListeners.getContainer(s); + ::comphelper::OInterfaceContainerHelper3* pListeners = m_aListeners.getContainer(s); if (!pListeners) continue; nLen += pListeners->getLength(); @@ -506,13 +506,13 @@ sal_Int32 SbaXVetoableChangeMultiplexer::getOverallLen() const return nLen; } -void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const css::beans::PropertyChangeEvent& e) +void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelper3& rListeners, const css::beans::PropertyChangeEvent& e) { css::beans::PropertyChangeEvent aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper2 aIt(rListeners); + ::comphelper::OInterfaceIteratorHelper3 aIt(rListeners); while (aIt.hasMoreElements()) - static_cast< css::beans::XVetoableChangeListener*>(aIt.next())->vetoableChange(aMulti); + aIt.next()->vetoableChange(aMulti); } // css::beans::XPropertiesChangeListener diff --git a/dbaccess/source/ui/inc/sbamultiplex.hxx b/dbaccess/source/ui/inc/sbamultiplex.hxx index a3af5d5e0af3..88d1ad3bf1a3 100644 --- a/dbaccess/source/ui/inc/sbamultiplex.hxx +++ b/dbaccess/source/ui/inc/sbamultiplex.hxx @@ -259,7 +259,7 @@ namespace dbaui :public OSbaWeakSubObject ,public css::beans::XVetoableChangeListener { - typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar2 ListenerContainerMap; + typedef ::comphelper::OMultiTypeInterfaceContainerHelperVar3 ListenerContainerMap; ListenerContainerMap m_aListeners; public: @@ -272,18 +272,18 @@ namespace dbaui virtual void SAL_CALL vetoableChange(const css::beans::PropertyChangeEvent& e) override; - void addInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); - void removeInterface(const OUString& rName, const css::uno::Reference< css::uno::XInterface >& rListener); + void addInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener); + void removeInterface(const OUString& rName, const css::uno::Reference< css::beans::XVetoableChangeListener >& rListener); void disposeAndClear(); sal_Int32 getOverallLen() const; - ::comphelper::OInterfaceContainerHelper2* getContainer(const OUString& rName) + ::comphelper::OInterfaceContainerHelper3* getContainer(const OUString& rName) { return m_aListeners.getContainer(rName); } private: - void Notify(::comphelper::OInterfaceContainerHelper2& rListeners, const css::beans::PropertyChangeEvent& e); + void Notify(::comphelper::OInterfaceContainerHelper3& rListeners, const css::beans::PropertyChangeEvent& e); }; // css::beans::XPropertiesChangeListener -- cgit