summaryrefslogtreecommitdiffstats
path: root/toolkit/source/controls/controlmodelcontainerbase.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-01-19 19:45:45 +0200
committerNoel Grandin <noel@peralex.com>2016-01-25 08:52:03 +0200
commit752cd07d085ac0aadc99bd512d49072843139032 (patch)
tree21ff2f55761b34bfdd721b5e1ed43333e8874e46 /toolkit/source/controls/controlmodelcontainerbase.cxx
parenttdf#86567 Dropdown for conditional formatting (diff)
downloadcore-752cd07d085ac0aadc99bd512d49072843139032.tar.gz
core-752cd07d085ac0aadc99bd512d49072843139032.zip
InterfaceContainer2 with vector instead of Sequence
create an InterfaceContainer2 class to replace InterfaceContainer. It uses a std::vector instead of a Sequence for the mutable listener list, which provides far better performance. Switch all our internal use-sites to the new class. Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
Diffstat (limited to 'toolkit/source/controls/controlmodelcontainerbase.cxx')
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index cf0c1ac6f36e..f137aeae762c 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -916,13 +916,11 @@ void ControlModelContainerBase::implNotifyTabModelChange( const OUString& _rAcce
aEvent.Changes[ 0 ].Accessor <<= _rAccessor;
- Sequence< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
- const Reference< XInterface >* pListener = aChangeListeners.getConstArray();
- const Reference< XInterface >* pListenerEnd = aChangeListeners.getConstArray() + aChangeListeners.getLength();
- for ( ; pListener != pListenerEnd; ++pListener )
+ std::vector< Reference< XInterface > > aChangeListeners( maChangeListeners.getElements() );
+ for ( const auto& rListener : aChangeListeners )
{
- if ( pListener->is() )
- static_cast< XChangesListener* >( pListener->get() )->changesOccurred( aEvent );
+ if ( rListener.is() )
+ static_cast< XChangesListener* >( rListener.get() )->changesOccurred( aEvent );
}
}