From f9f5c9f0d6af2cb2f39d5bc1513216b8d892977c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 Dec 2021 09:38:14 +0200 Subject: replace comphelper::OListenerContainer with OInterfaceContainerHelper3 OInterfaceContainerHelper3 is in wide use and can do the same thing with less ceremony Change-Id: I5252738d6b7bda6245c66da46352944ead79bd52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126271 Tested-by: Jenkins Reviewed-by: Noel Grandin --- reportdesign/source/ui/inc/GeometryHandler.hxx | 6 ++---- reportdesign/source/ui/inspection/GeometryHandler.cxx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx index 79fb54433238..13d08414c482 100644 --- a/reportdesign/source/ui/inc/GeometryHandler.hxx +++ b/reportdesign/source/ui/inc/GeometryHandler.hxx @@ -38,8 +38,8 @@ #include #include +#include #include -#include namespace rptui @@ -60,9 +60,7 @@ namespace rptui class OPropertyInfoService; typedef ::std::pair< css::uno::Reference< css::report::XFunction>, css::uno::Reference< css::report::XFunctionsSupplier> > TFunctionPair; typedef ::std::multimap< OUString,TFunctionPair, ::comphelper::UStringMixLess > TFunctions; - typedef ::comphelper::OSimpleListenerContainer < css::beans::XPropertyChangeListener - , css::beans::PropertyChangeEvent - > PropertyChangeListeners; + typedef ::comphelper::OInterfaceContainerHelper3< css::beans::XPropertyChangeListener > PropertyChangeListeners; typedef ::cppu::WeakComponentImplHelper< css::inspection::XPropertyHandler , css::beans::XPropertyChangeListener , css::lang::XServiceInfo> GeometryHandler_Base; diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 26a7878cc0ab..4dd7ac4df9c7 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -488,7 +488,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const OUString & PropertyName, c m_sScope.clear(); aEvent.NewValue <<= m_sScope; aGuard.clear(); - m_aPropertyListeners.notify( aEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aEvent ); } else if ( m_nDataFieldType == USER_DEF_FUNCTION ) { @@ -1242,14 +1242,14 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const OUString & Proper void SAL_CALL GeometryHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) { ::osl::MutexGuard aGuard( m_aMutex ); - m_aPropertyListeners.addListener( _rxListener ); + m_aPropertyListeners.addInterface( _rxListener ); m_xFormComponentHandler->addPropertyChangeListener(_rxListener); } void SAL_CALL GeometryHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) { ::osl::MutexGuard aGuard( m_aMutex ); - m_aPropertyListeners.removeListener( _rxListener ); + m_aPropertyListeners.removeInterface( _rxListener ); m_xFormComponentHandler->removePropertyChangeListener(_rxListener); } @@ -1444,7 +1444,7 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr beans::PropertyChangeEvent aScopeEvent; aScopeEvent.PropertyName = PROPERTY_FILLCOLOR; aScopeEvent.NewValue = xShape->getPropertyValue(PROPERTY_FILLCOLOR); - m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aScopeEvent ); } return eResult; } @@ -1954,7 +1954,7 @@ void GeometryHandler::createDefaultFunction(::osl::ResettableMutexGuard& _aGuard m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny( impl_convertToFormula( uno::makeAny(sQuotedFunctionName) ))); aEvent.NewValue <<= m_sScope; _aGuard.clear(); - m_aPropertyListeners.notify( aEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aEvent ); } } catch(uno::Exception&) @@ -1996,7 +1996,7 @@ void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,co aScopeEvent.PropertyName = PROPERTY_TYPE; aScopeEvent.OldValue <<= _nOldDataFieldType; aScopeEvent.NewValue <<= nNewDataFieldType; - m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aScopeEvent ); } if ( _sOldFunctionName != sNewFunction ) { @@ -2005,7 +2005,7 @@ void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,co aFormulaEvent.OldValue <<= _sOldFunctionName; aFormulaEvent.NewValue <<= sNewFunction; - m_aPropertyListeners.notify( aFormulaEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aFormulaEvent ); } if ( _sOldScope != sNewScope ) { @@ -2013,7 +2013,7 @@ void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,co aScopeEvent.PropertyName = PROPERTY_SCOPE; aScopeEvent.OldValue <<= _sOldScope; aScopeEvent.NewValue <<= sNewScope; - m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); + m_aPropertyListeners.notifyEach( &beans::XPropertyChangeListener::propertyChange, aScopeEvent ); } _aGuard.reset(); -- cgit