diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-05-08 16:05:51 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-05-09 01:41:29 +0200 |
commit | ffa08644b92988e21669edc612dd731f985c341a (patch) | |
tree | c914de98256f8e854f5504755723877a319a3f3d /toolkit | |
parent | 6aef5a1e880262354cf739e461a12a0ef9573fef (diff) |
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.weghorn@posteo.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/inc/controls/controlmodelcontainerbase.hxx | 1 | ||||
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 17 |
2 files changed, 1 insertions, 17 deletions
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 |