diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2017-10-09 21:04:19 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2017-10-09 22:53:12 +0200 |
commit | af7b62ea9e54dba4923b004ef921a20c83c2a836 (patch) | |
tree | 47859e96a8baaa0e961090621aedb027f010ae34 | |
parent | 1da3a2d32d89da8467424e1b092711a073fbdc8d (diff) |
Replace lists by vectors in controlmodelcontainerbase (toolkit)
Change-Id: I614433b16501812a80c9d4f78abb499f96fecd26
Reviewed-on: https://gerrit.libreoffice.org/43293
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | include/toolkit/controls/controlmodelcontainerbase.hxx | 8 | ||||
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/include/toolkit/controls/controlmodelcontainerbase.hxx b/include/toolkit/controls/controlmodelcontainerbase.hxx index 3c92013a4f4d..aba3ff1362a0 100644 --- a/include/toolkit/controls/controlmodelcontainerbase.hxx +++ b/include/toolkit/controls/controlmodelcontainerbase.hxx @@ -41,7 +41,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <tools/gen.hxx> -#include <list> +#include <vector> // class ControlModelContainerBase @@ -66,7 +66,7 @@ public: typedef ::std::pair< css::uno::Reference< css::awt::XControlModel >, OUString > UnoControlModelHolder; private: - typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList; + typedef ::std::vector< UnoControlModelHolder > UnoControlModelHolderVector; public: // for grouping control models (XTabControllerModel::getGroupXXX) @@ -81,7 +81,7 @@ public: protected: ContainerListenerMultiplexer maContainerListeners; ::comphelper::OInterfaceContainerHelper2 maChangeListeners; - UnoControlModelHolderList maModels; + UnoControlModelHolderVector maModels; AllGroups maGroups; bool mbGroupsUpToDate; @@ -96,7 +96,7 @@ protected: css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override; ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; - UnoControlModelHolderList::iterator ImplFindElement( const OUString& rName ); + UnoControlModelHolderVector::iterator ImplFindElement( const OUString& rName ); /// @throws css::lang::IllegalArgumentException /// @throws css::container::ElementExistException diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 291894605b49..c4ae5a7cf6a9 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -133,11 +133,11 @@ public: struct CloneControlModel { private: - ControlModelContainerBase::UnoControlModelHolderList& m_rTargetList; + ControlModelContainerBase::UnoControlModelHolderVector& m_rTargetVector; public: - explicit CloneControlModel( ControlModelContainerBase::UnoControlModelHolderList& _rTargetList ) - :m_rTargetList( _rTargetList ) + explicit CloneControlModel( ControlModelContainerBase::UnoControlModelHolderVector& _rTargetVector ) + :m_rTargetVector( _rTargetVector ) { } @@ -147,7 +147,7 @@ public: Reference< XCloneable > xCloneSource( _rSource.first, UNO_QUERY ); Reference< XControlModel > xClone( xCloneSource->createClone(), UNO_QUERY ); // add to target list - m_rTargetList.emplace_back( xClone, _rSource.second ); + m_rTargetVector.emplace_back( xClone, _rSource.second ); } }; @@ -312,7 +312,7 @@ UnoControlModel* ControlModelContainerBase::Clone() const return pClone; } -ControlModelContainerBase::UnoControlModelHolderList::iterator ControlModelContainerBase::ImplFindElement( const OUString& rName ) +ControlModelContainerBase::UnoControlModelHolderVector::iterator ControlModelContainerBase::ImplFindElement( const OUString& rName ) { return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) ); } @@ -480,7 +480,7 @@ void ControlModelContainerBase::replaceByName( const OUString& aName, const Any& if ( !xNewModel.is() ) lcl_throwIllegalArgumentException(); - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); + UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) lcl_throwNoSuchElementException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) @@ -519,7 +519,7 @@ void ControlModelContainerBase::replaceByName( const OUString& aName, const Any& Any ControlModelContainerBase::getByName( const OUString& aName ) { - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); + UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) lcl_throwNoSuchElementException(); @@ -579,7 +579,7 @@ void ControlModelContainerBase::insertByName( const OUString& aName, const Any& if ( aName.isEmpty() || !xM.is() ) lcl_throwIllegalArgumentException(); - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); + UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() != aElementPos ) lcl_throwElementExistException(); @@ -612,7 +612,7 @@ void ControlModelContainerBase::removeByName( const OUString& aName ) { SolarMutexGuard aGuard; - UnoControlModelHolderList::iterator aElementPos = ImplFindElement( aName ); + UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) lcl_throwNoSuchElementException(); @@ -676,7 +676,7 @@ void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Refer for ( auto const & control : _rControls ) { // look up the control in our own structure. This is to prevent invalid arguments - UnoControlModelHolderList::const_iterator aPos = + UnoControlModelHolderVector::const_iterator aPos = ::std::find_if( maModels.begin(), maModels.end(), CompareControlModel( control ) @@ -709,7 +709,7 @@ Sequence< Reference< XControlModel > > SAL_CALL ControlModelContainerBase::getCo ::std::vector< Reference< XControlModel > > aUnindexedModels; // will be the container of all models which do not have a tab index property - UnoControlModelHolderList::const_iterator aLoop = maModels.begin(); + UnoControlModelHolderVector::const_iterator aLoop = maModels.begin(); for ( ; aLoop != maModels.end(); ++aLoop ) { Reference< XControlModel > xModel( aLoop->first ); @@ -1029,7 +1029,7 @@ void SAL_CALL ControlModelContainerBase::propertyChange( const PropertyChangeEve // the accessor for the changed element OUString sAccessor; - UnoControlModelHolderList::const_iterator aPos = + UnoControlModelHolderVector::const_iterator aPos = ::std::find_if( maModels.begin(), maModels.end(), CompareControlModel( Reference< XControlModel >( _rEvent.Source, UNO_QUERY ) ) |