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 /ucb | |
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>
Diffstat (limited to 'ucb')
-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 |
3 files changed, 9 insertions, 52 deletions
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 ); } |