From 7994791e0a3681d46d8b257f09422b04deeae41c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 16 Dec 2021 16:08:48 +0200 Subject: use more OInterfaceContainer3::notifyEach Change-Id: I0dd6e9f1514792e73a31e81896d09c27c1912318 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126966 Tested-by: Jenkins Reviewed-by: Noel Grandin --- forms/source/component/DatabaseForm.cxx | 10 ++-------- forms/source/component/errorbroadcaster.cxx | 7 +------ 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'forms') 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 ); } -- cgit