diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-16 16:08:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-17 07:26:25 +0100 |
commit | 7994791e0a3681d46d8b257f09422b04deeae41c (patch) | |
tree | e04944776200e5bad5ac80618aaf3270a23c26d6 | |
parent | 134425eb98147d197833cb4ef7bb4d8c3d7fd2bc (diff) |
use more OInterfaceContainer3::notifyEach
Change-Id: I0dd6e9f1514792e73a31e81896d09c27c1912318
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126966
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | comphelper/source/eventattachermgr/eventattachermgr.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/ContentHelper.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/bookmarkcontainer.cxx | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/exsrcbrw.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/formadapter.cxx | 26 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbamultiplex.cxx | 56 | ||||
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 10 | ||||
-rw-r--r-- | forms/source/component/errorbroadcaster.cxx | 7 | ||||
-rw-r--r-- | linguistic/source/lngopt.cxx | 8 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomailmerge.cxx | 6 | ||||
-rw-r--r-- | ucb/source/cacher/contentresultsetwrapper.cxx | 24 | ||||
-rw-r--r-- | ucb/source/core/ucbstore.cxx | 21 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 16 | ||||
-rw-r--r-- | ucbhelper/source/provider/contenthelper.cxx | 8 |
19 files changed, 50 insertions, 191 deletions
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 35e90a8379b0..4c7be22c2bb1 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -179,9 +179,7 @@ void SAL_CALL AttacherAllListener_Impl::firing(const AllEventObject& Event) aScriptEvent.ScriptCode = aScriptCode; // Iterate over all listeners and pass events. - OInterfaceIteratorHelper3 aIt( mxManager->aScriptListeners ); - while( aIt.hasMoreElements() ) - aIt.next()->firing( aScriptEvent ); + mxManager->aScriptListeners.notifyEach( &XScriptListener::firing, aScriptEvent ); } diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index beb75c3d40dd..cefc2443d2c2 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -505,14 +505,7 @@ void OContentHelper::notifyPropertiesChange( const Sequence< PropertyChangeEvent // First, notify listeners interested in changes of every property. comphelper::OInterfaceContainerHelper3<XPropertiesChangeListener>* pAllPropsContainer = m_aPropertyChangeListeners.getContainer( OUString() ); if ( pAllPropsContainer ) - { - comphelper::OInterfaceIteratorHelper3 aIter( *pAllPropsContainer ); - while ( aIter.hasMoreElements() ) - { - // Propagate event. - aIter.next()->propertiesChange( evt ); - } - } + pAllPropsContainer->notifyEach( &XPropertiesChangeListener::propertiesChange, evt ); typedef std::map< XPropertiesChangeListener*, Sequence< PropertyChangeEvent > > PropertiesEventListenerMap; PropertiesEventListenerMap aListeners; diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx index bee7a0cbb7b9..24feb1371ed0 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx @@ -97,9 +97,7 @@ void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const An if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), Any()); - OInterfaceIteratorHelper3 aListenerIterator(m_aContainerListeners); - while (aListenerIterator.hasMoreElements()) - aListenerIterator.next()->elementInserted(aEvent); + m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent ); } } @@ -127,9 +125,7 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sOldBookmark), Any()); - OInterfaceIteratorHelper3 aListenerIterator(m_aContainerListeners); - while (aListenerIterator.hasMoreElements()) - aListenerIterator.next()->elementRemoved(aEvent); + m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent ); } } @@ -162,9 +158,7 @@ void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const A if (m_aContainerListeners.getLength()) { ContainerEvent aEvent(*this, makeAny(_rName), makeAny(sNewLink), makeAny(sOldLink)); - OInterfaceIteratorHelper3 aListenerIterator(m_aContainerListeners); - while (aListenerIterator.hasMoreElements()) - aListenerIterator.next()->elementReplaced(aEvent); + m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, aEvent ); } } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 65333da089f9..7b9a2ecf78e2 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -902,9 +902,7 @@ void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/) { // notify our activate listeners (registered on the form controller aggregate) EventObject aEvt(*this); - ::comphelper::OInterfaceIteratorHelper3 aIter(m_xFormControllerImpl->m_aActivateListeners); - while (aIter.hasMoreElements()) - aIter.next()->formActivated(aEvt); + m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formActivated, aEvt ); } void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) @@ -928,9 +926,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) // notify the listeners that the "form" we represent has been deactivated EventObject aEvt(*this); - ::comphelper::OInterfaceIteratorHelper3 aIter(m_xFormControllerImpl->m_aActivateListeners); - while (aIter.hasMoreElements()) - aIter.next()->formDeactivated(aEvt); + m_xFormControllerImpl->m_aActivateListeners.notifyEach( &css::form::XFormControllerListener::formDeactivated, aEvt ); // commit the changes of the grid control (as we're deactivated) Reference< XBoundComponent > xCommitable(getBrowserView()->getGridControl(), UNO_QUERY); diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 2b304f23e511..c7640e626d20 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -104,9 +104,7 @@ void SbaExternalSourceBrowser::modified(const css::lang::EventObject& aEvent) // multiplex this event to all my listeners css::lang::EventObject aEvt(*this); - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aModifyListeners); - while (aIt.hasMoreElements()) - aIt.next()->modified(aEvt); + m_aModifyListeners.notifyEach( &css::util::XModifyListener::modified, aEvt ); } void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, const Sequence< css::beans::PropertyValue>& aArgs) diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index 1f042a58ae8d..bfa6923f9743 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -249,9 +249,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast if (xLoadable->isLoaded()) { css::lang::EventObject aEvt(*this); - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aLoadListeners); - while (aIt.hasMoreElements()) - aIt.next()->unloaded(aEvt); + m_aLoadListeners.notifyEach( &css::form::XLoadListener::unloaded, aEvt ); } } @@ -267,9 +265,7 @@ void SbaXFormAdapter::AttachForm(const Reference< css::sdbc::XRowSet >& xNewMast if (xLoadable->isLoaded()) { css::lang::EventObject aEvt(*this); - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aLoadListeners); - while (aIt.hasMoreElements()) - aIt.next()->loaded(aEvt); + m_aLoadListeners.notifyEach( &css::form::XLoadListener::loaded, aEvt ); } // TODO : perhaps _all_ of our listeners should be notified about our new state @@ -1312,9 +1308,8 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any aValue >>= m_sName; - ::comphelper::OInterfaceIteratorHelper3 aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME)); - while (aIt.hasMoreElements()) - aIt.next()->propertyChange(aEvt); + m_aPropertyChangeListeners.getContainer(PROPERTY_NAME)->notifyEach( + &XPropertyChangeListener::propertyChange, aEvt ); return; } @@ -1649,9 +1644,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU aEvt.Source = *this; aEvt.Accessor <<= nIndex; aEvt.Element <<= xElement; - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aContainerListeners); - while (aIt.hasMoreElements()) - aIt.next()->elementInserted(aEvt); + m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvt ); } sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName) @@ -1754,10 +1747,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) css::container::ContainerEvent aEvt; aEvt.Source = *this; aEvt.Element <<= xAffected; - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aContainerListeners); - while (aIt.hasMoreElements()) - aIt.next()->elementRemoved(aEvt); - + m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvt ); } // css::container::XIndexReplace @@ -1817,9 +1807,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem aEvt.Element <<= xElement; aEvt.ReplacedElement <<= xOld; - ::comphelper::OInterfaceIteratorHelper3 aIt(m_aContainerListeners); - while (aIt.hasMoreElements()) - aIt.next()->elementReplaced(aEvt); + m_aContainerListeners.notifyEach( &XContainerListener::elementReplaced, aEvt ); } // css::container::XIndexAccess diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 5c8ab2095d60..fb768ac21c91 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -285,9 +285,7 @@ void SbaXGridPeer::NotifyStatusChanged(const css::util::URL& _rUrl, const Refere if (pIter) { - ::comphelper::OInterfaceIteratorHelper3 aListIter(*pIter); - while (aListIter.hasMoreElements()) - aListIter.next()->statusChanged(aEvt); + pIter->notifyEach( &XStatusListener::statusChanged, aEvt ); } } } diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx index 48e907221b39..2c2db8163dab 100644 --- a/dbaccess/source/ui/browser/sbamultiplex.cxx +++ b/dbaccess/source/ui/browser/sbamultiplex.cxx @@ -49,9 +49,7 @@ void SAL_CALL SbaXStatusMultiplexer::statusChanged(const css::frame::FeatureStat { m_aLastKnownStatus = e; m_aLastKnownStatus.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt( *this ); - while ( aIt.hasMoreElements() ) - aIt.next()->statusChanged( m_aLastKnownStatus ); + notifyEach( &XStatusListener::statusChanged, m_aLastKnownStatus ); } // LoadListener @@ -80,44 +78,34 @@ void SAL_CALL SbaXLoadMultiplexer::loaded(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->loaded(aMulti); + notifyEach( &XLoadListener::loaded, aMulti ); } void SAL_CALL SbaXLoadMultiplexer::unloaded(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->unloaded(aMulti); + notifyEach( &XLoadListener::unloaded, aMulti ); } void SAL_CALL SbaXLoadMultiplexer::unloading(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->unloading(aMulti); + notifyEach( &XLoadListener::unloading, aMulti ); } void SAL_CALL SbaXLoadMultiplexer::reloading(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->reloading(aMulti); + notifyEach( &XLoadListener::reloading, aMulti ); } void SAL_CALL SbaXLoadMultiplexer::reloaded(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->reloaded(aMulti); + notifyEach( &XLoadListener::reloaded, aMulti ); } @@ -147,27 +135,21 @@ void SAL_CALL SbaXRowSetMultiplexer::cursorMoved(const css::lang::EventObject& e { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->cursorMoved(aMulti); + notifyEach( &XRowSetListener::cursorMoved, aMulti ); } void SAL_CALL SbaXRowSetMultiplexer::rowChanged(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->rowChanged(aMulti); + notifyEach( &XRowSetListener::rowChanged, aMulti ); } void SAL_CALL SbaXRowSetMultiplexer::rowSetChanged(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->rowSetChanged(aMulti); + notifyEach( &XRowSetListener::rowSetChanged, aMulti ); } // css::sdb::XRowSetApproveListener @@ -251,9 +233,7 @@ void SAL_CALL SbaXSQLErrorMultiplexer::errorOccured(const css::sdb::SQLErrorEven { css::sdb::SQLErrorEvent aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->errorOccured(aMulti); + notifyEach( &XSQLErrorListener::errorOccured, aMulti ); } // css::form::XDatabaseParameterListener @@ -362,9 +342,7 @@ void SAL_CALL SbaXResetMultiplexer::resetted(const css::lang::EventObject& e) { css::lang::EventObject aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->resetted(aMulti); + notifyEach( &XResetListener::resetted, aMulti ); } // css::beans::XPropertyChangeListener @@ -436,9 +414,7 @@ void SbaXPropertyChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelp { css::beans::PropertyChangeEvent aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(rListeners); - while (aIt.hasMoreElements()) - aIt.next()->propertyChange(aMulti); + rListeners.notifyEach( &XPropertyChangeListener::propertyChange, aMulti ); } // css::beans::XVetoableChangeListener @@ -510,9 +486,7 @@ void SbaXVetoableChangeMultiplexer::Notify(::comphelper::OInterfaceContainerHelp { css::beans::PropertyChangeEvent aMulti(e); aMulti.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(rListeners); - while (aIt.hasMoreElements()) - aIt.next()->vetoableChange(aMulti); + rListeners.notifyEach( &XVetoableChangeListener::vetoableChange, aMulti ); } // css::beans::XPropertiesChangeListener @@ -546,9 +520,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence< for (css::beans::PropertyChangeEvent & rEvent : asNonConstRange(aMulti)) rEvent.Source = &m_rParent; - ::comphelper::OInterfaceIteratorHelper3 aIt(*this); - while (aIt.hasMoreElements()) - aIt.next()->propertiesChange(aMulti); + notifyEach( &css::beans::XPropertiesChangeListener::propertiesChange, aMulti ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 3aefbd798ade..45ffd5e595f1 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2930,12 +2930,8 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction // the approval is done by the aggregate if (!m_aRowSetApproveListeners.getLength()) { - ::comphelper::OInterfaceIteratorHelper3 aIter(m_aLoadListeners); aGuard.clear(); - - while (aIter.hasMoreElements()) - aIter.next()->reloading(aEvent); - + m_aLoadListeners.notifyEach( &XLoadListener::reloading, aEvent); aGuard.reset(); } } @@ -2953,10 +2949,8 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction if (bSuccess) { - ::comphelper::OInterfaceIteratorHelper3 aIter(m_aLoadListeners); aGuard.clear(); - while (aIter.hasMoreElements()) - aIter.next()->reloaded(aEvent); + m_aLoadListeners.notifyEach( &XLoadListener::reloaded, aEvent); // if we are on the insert row, we have to reset all controls // to set the default values diff --git a/forms/source/component/errorbroadcaster.cxx b/forms/source/component/errorbroadcaster.cxx index e22cd2efbb74..7f37e4e0e95a 100644 --- a/forms/source/component/errorbroadcaster.cxx +++ b/forms/source/component/errorbroadcaster.cxx @@ -72,12 +72,7 @@ namespace frm void OErrorBroadcaster::onError( const css::sdb::SQLErrorEvent& _rError ) { - if ( m_aErrorListeners.getLength() ) - { - ::comphelper::OInterfaceIteratorHelper3 aIter( m_aErrorListeners ); - while ( aIter.hasMoreElements() ) - aIter.next()->errorOccured( _rError ); - } + m_aErrorListeners.notifyEach( &XSQLErrorListener::errorOccured, _rError ); } diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index f176735f37cf..1b36c43c3075 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -195,13 +195,7 @@ void LinguProps::launchEvent( const PropertyChangeEvent &rEvt ) const comphelper::OInterfaceContainerHelper3<XPropertyChangeListener> *pContainer = aPropListeners.getContainer( rEvt.PropertyHandle ); if (pContainer) - { - comphelper::OInterfaceIteratorHelper3 aIt( *pContainer ); - while (aIt.hasMoreElements()) - { - aIt.next()->propertyChange( rEvt ); - } - } + pContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); } Reference< XPropertySetInfo > SAL_CALL LinguProps::getPropertySetInfo() diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index bfe8ff4d6dcb..dfe43faf5963 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -4301,15 +4301,12 @@ IMPL_LINK(FmXListBoxCell, ChangedHdl, bool, bInteractive, void) void FmXListBoxCell::OnDoubleClick() { - ::comphelper::OInterfaceIteratorHelper3 aIt( m_aActionListeners ); - css::awt::ActionEvent aEvent; aEvent.Source = *this; weld::ComboBox& rBox = m_pBox->get_widget(); aEvent.ActionCommand = rBox.get_active_text(); - while( aIt.hasMoreElements() ) - aIt.next()->actionPerformed( aEvent ); + m_aActionListeners.notifyEach( &css::awt::XActionListener::actionPerformed, aEvent ); } FmXComboBoxCell::FmXComboBoxCell( DbGridColumn* pColumn, std::unique_ptr<DbCellControl> pControl ) @@ -4620,11 +4617,9 @@ void SAL_CALL FmXFilterCell::setMaxTextLen( sal_Int16 /*nLen*/ ) IMPL_LINK_NOARG(FmXFilterCell, OnCommit, DbFilterField&, void) { - ::comphelper::OInterfaceIteratorHelper3 aIt( m_aTextListeners ); css::awt::TextEvent aEvt; aEvt.Source = *this; - while( aIt.hasMoreElements() ) - aIt.next()->textChanged( aEvt ); + m_aTextListeners.notifyEach( &css::awt::XTextListener::textChanged, aEvt ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 4ae947545c9b..ef60775a6e3d 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -160,9 +160,7 @@ static void LaunchModifiedEvent( const uno::Reference< uno::XInterface > &rxI ) { lang::EventObject aEvtObj( rxI ); - comphelper::OInterfaceIteratorHelper3 aIt( rICH ); - while (aIt.hasMoreElements()) - aIt.next()->modified( aEvtObj ); + rICH.notifyEach( &util::XModifyListener::modified, aEvtObj ); } /** diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index bf26e57476af..e383dfc462b0 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -1368,10 +1368,7 @@ SwPasteContext::~SwPasteContext() // Invoke the listeners. uno::Sequence<beans::PropertyValue> aEvent{ aPropertyValue }; - - comphelper::OInterfaceIteratorHelper3 it(m_rWrtShell.GetPasteListeners()); - while (it.hasMoreElements()) - it.next()->notifyPasteEvent(aEvent); + m_rWrtShell.GetPasteListeners().notifyEach( &css::text::XPasteListener::notifyPasteEvent, aEvent ); } catch (const uno::Exception& rException) { diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 417278c20722..6229177bed2c 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -843,11 +843,7 @@ void SwXMailMerge::launchEvent( const PropertyChangeEvent &rEvt ) const m_aPropListeners.getContainer( rEvt.PropertyHandle ); if (pContainer) { - comphelper::OInterfaceIteratorHelper3 aIt( *pContainer ); - while (aIt.hasMoreElements()) - { - aIt.next()->propertyChange( rEvt ); - } + pContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); } } diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx b/ucb/source/cacher/contentresultsetwrapper.cxx index f19353446dde..8e8542e98f26 100644 --- a/ucb/source/cacher/contentresultsetwrapper.cxx +++ b/ucb/source/cacher/contentresultsetwrapper.cxx @@ -185,22 +185,14 @@ void ContentResultSetWrapper::impl_notifyPropertyChangeListeners( const Property m_pPropertyChangeListeners->getContainer( rEvt.PropertyName ); if( pContainer ) { - OInterfaceIteratorHelper3 aIter( *pContainer ); - while( aIter.hasMoreElements() ) - { - aIter.next()->propertyChange( rEvt ); - } + pContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); } // Notify listeners interested in all properties. pContainer = m_pPropertyChangeListeners->getContainer( OUString() ); if( pContainer ) { - OInterfaceIteratorHelper3 aIter( *pContainer ); - while( aIter.hasMoreElements() ) - { - aIter.next()->propertyChange( rEvt ); - } + pContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); } } @@ -217,22 +209,14 @@ void ContentResultSetWrapper::impl_notifyVetoableChangeListeners( const Property m_pVetoableChangeListeners->getContainer( rEvt.PropertyName ); if( pContainer ) { - OInterfaceIteratorHelper3 aIter( *pContainer ); - while( aIter.hasMoreElements() ) - { - aIter.next()->vetoableChange( rEvt ); - } + pContainer->notifyEach( &XVetoableChangeListener::vetoableChange, rEvt ); } // Notify listeners interested in all properties. pContainer = m_pVetoableChangeListeners->getContainer( OUString() ); if( pContainer ) { - OInterfaceIteratorHelper3 aIter( *pContainer ); - while( aIter.hasMoreElements() ) - { - aIter.next()->vetoableChange( rEvt ); - } + pContainer->notifyEach( &XVetoableChangeListener::vetoableChange, rEvt ); } } diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 9d0301e16268..a0eece461c7d 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -1906,12 +1906,7 @@ void PersistentPropertySet::notifyPropertyChangeEvent( m_pPropertyChangeListeners->getContainer( rEvent.PropertyName ); if ( pContainer && pContainer->getLength() ) { - OInterfaceIteratorHelper3 aIter( *pContainer ); - while ( aIter.hasMoreElements() ) - { - // Propagate event. - aIter.next()->propertyChange( rEvent ); - } + pContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvent ); } // Get "normal" listeners for all properties. @@ -1919,12 +1914,7 @@ void PersistentPropertySet::notifyPropertyChangeEvent( m_pPropertyChangeListeners->getContainer( OUString() ); if ( pNoNameContainer && pNoNameContainer->getLength() ) { - OInterfaceIteratorHelper3 aIter( *pNoNameContainer ); - while ( aIter.hasMoreElements() ) - { - // Propagate event. - aIter.next()->propertyChange( rEvent ); - } + pNoNameContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvent ); } } @@ -1936,12 +1926,7 @@ void PersistentPropertySet::notifyPropertySetInfoChange( return; // Notify event listeners. - OInterfaceIteratorHelper3 aIter( *m_pPropSetChangeListeners ); - while ( aIter.hasMoreElements() ) - { - // Propagate event. - aIter.next()->propertySetInfoChange( evt ); - } + m_pPropSetChangeListeners->notifyEach( &XPropertySetInfoChangeListener::propertySetInfoChange, evt ); } diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 1f28a308dc9b..0af835978c9a 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -1186,24 +1186,12 @@ void SortedResultSet::PropertyChanged( const PropertyChangeEvent& rEvt ) OInterfaceContainerHelper3<XPropertyChangeListener>* pPropsContainer = mpPropChangeListeners->getContainer( rEvt.PropertyName ); if ( pPropsContainer ) - { - OInterfaceIteratorHelper3 aIter( *pPropsContainer ); - while ( aIter.hasMoreElements() ) - { - aIter.next()->propertyChange( rEvt ); - } - } + pPropsContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); // Notify listeners interested in all properties. pPropsContainer = mpPropChangeListeners->getContainer( OUString() ); if ( pPropsContainer ) - { - OInterfaceIteratorHelper3 aIter( *pPropsContainer ); - while ( aIter.hasMoreElements() ) - { - aIter.next()->propertyChange( rEvt ); - } - } + pPropsContainer->notifyEach( &XPropertyChangeListener::propertyChange, rEvt ); } diff --git a/ucbhelper/source/provider/contenthelper.cxx b/ucbhelper/source/provider/contenthelper.cxx index 4cf93d1207b9..75d0a8479860 100644 --- a/ucbhelper/source/provider/contenthelper.cxx +++ b/ucbhelper/source/provider/contenthelper.cxx @@ -724,9 +724,7 @@ void ContentImplHelper::notifyPropertySetInfoChange( return; // Notify event listeners. - comphelper::OInterfaceIteratorHelper3 aIter( *m_pImpl->m_pPropSetChangeListeners ); - while ( aIter.hasMoreElements() ) - aIter.next()->propertySetInfoChange( evt ); + m_pImpl->m_pPropSetChangeListeners->notifyEach( &beans::XPropertySetInfoChangeListener::propertySetInfoChange, evt ); } void ContentImplHelper::notifyContentEvent( @@ -736,9 +734,7 @@ void ContentImplHelper::notifyContentEvent( return; // Notify event listeners. - comphelper::OInterfaceIteratorHelper3 aIter( *m_pImpl->m_pContentEventListeners ); - while ( aIter.hasMoreElements() ) - aIter.next()->contentEvent( evt ); + m_pImpl->m_pContentEventListeners->notifyEach( &css::ucb::XContentEventListener::contentEvent, evt); } void ContentImplHelper::inserted() |