toolkit/inc/controls/controlmodelcontainerbase.hxx | 1 - toolkit/source/controls/controlmodelcontainerbase.cxx | 17 +---------------- 2 files changed, 1 insertion(+), 17 deletions(-)
New commits: commit ffa08644b92988e21669edc612dd731f985c341a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri May 8 16:05:51 2020 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat May 9 01:41:29 2020 +0200 toolkit: Use lambda instead of FindControlModel functor Change-Id: I04cbd84196b5bf31caa4da3140dc65b1dfa20127 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93746 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/toolkit/inc/controls/controlmodelcontainerbase.hxx b/toolkit/inc/controls/controlmodelcontainerbase.hxx index 6ce71a45c881..747795bd488d 100644 --- a/toolkit/inc/controls/controlmodelcontainerbase.hxx +++ b/toolkit/inc/controls/controlmodelcontainerbase.hxx @@ -73,7 +73,6 @@ public: typedef ::std::vector< ModelGroup > AllGroups; friend struct CloneControlModel; - friend struct FindControlModel; friend struct CompareControlModel; protected: diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index eb39c1ba1b95..cc92f9fb7345 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -94,21 +94,6 @@ struct DisposeControlModel } -// functor for searching control model by name -struct FindControlModel -{ -private: - const OUString& m_rName; - -public: - explicit FindControlModel( const OUString& _rName ) : m_rName( _rName ) { } - - bool operator()( const ControlModelContainerBase::UnoControlModelHolder& _rCompare ) - { - return _rCompare.second == m_rName; - } -}; - // functor for cloning a control model, and insertion into a target list struct CloneControlModel @@ -289,7 +274,7 @@ rtl::Reference<UnoControlModel> ControlModelContainerBase::Clone() const ControlModelContainerBase::UnoControlModelHolderVector::iterator ControlModelContainerBase::ImplFindElement( const OUString& rName ) { - return ::std::find_if( maModels.begin(), maModels.end(), FindControlModel( rName ) ); + return ::std::find_if( maModels.begin(), maModels.end(), [&](const UnoControlModelHolder& elem) { return elem.second == rName; }); } // ::XMultiServiceFactory _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits