[Libreoffice-commits] core.git: configmgr/source
Mario J. Rugiero
mrugiero at gmail.com
Sun Nov 8 22:08:00 PST 2015
configmgr/source/setnode.cxx | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
New commits:
commit e589f187e47bf2d5a9bf8e96e050189b7782cb77
Author: Mario J. Rugiero <mrugiero at gmail.com>
Date: Sun Nov 8 20:49:09 2015 -0300
Replace a local functor in configmgr by a lambda.
Change-Id: Ida4317ec6b96ab8cb3362243b4acace3680bcd31
Reviewed-on: https://gerrit.libreoffice.org/19846
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx
index b26188d..18ad537 100644
--- a/configmgr/source/setnode.cxx
+++ b/configmgr/source/setnode.cxx
@@ -33,26 +33,6 @@
namespace configmgr {
-namespace {
-
-// Work around some compilers' failure to accept
-// std::binder1st(std::ptr_fun(&Data::equalTemplateNames), ...):
-class EqualTemplateNames:
- public std::unary_function< OUString const &, bool >
-{
-public:
- inline explicit EqualTemplateNames(OUString const & shortName):
- shortName_(shortName) {}
-
- inline bool operator ()(OUString const & longName) const
- { return Data::equalTemplateNames(shortName_, longName); }
-
-private:
- OUString const & shortName_;
-};
-
-}
-
SetNode::SetNode(
int layer, OUString const & defaultTemplateName,
OUString const & templateName):
@@ -86,7 +66,8 @@ bool SetNode::isValidTemplate(OUString const & templateName) const {
return Data::equalTemplateNames(templateName, defaultTemplateName_) ||
(std::find_if(
additionalTemplateNames_.begin(),
- additionalTemplateNames_.end(), EqualTemplateNames(templateName)) !=
+ additionalTemplateNames_.end(),
+ [&templateName](OUString const & longName) { return Data::equalTemplateNames(templateName, longName); } ) !=
additionalTemplateNames_.end());
}
More information about the Libreoffice-commits
mailing list