From 5c59051deb1b1294b3a6985bc753d639bf943fae Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 27 Aug 2019 14:05:20 -0400 Subject: Use lambda expression here instead of a function object. Change-Id: I469cc9fa0506153e6dc4ff8fe6d5bad19c02b285 Reviewed-on: https://gerrit.libreoffice.org/78208 Tested-by: Jenkins Reviewed-by: Kohei Yoshida --- sc/source/filter/orcus/xmlcontext.cxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/orcus/xmlcontext.cxx b/sc/source/filter/orcus/xmlcontext.cxx index 18574b0c2a1f..489878391b29 100644 --- a/sc/source/filter/orcus/xmlcontext.cxx +++ b/sc/source/filter/orcus/xmlcontext.cxx @@ -135,17 +135,6 @@ public: } }; -class InsertFieldPath -{ - orcus::orcus_xml& mrFilter; -public: - explicit InsertFieldPath(orcus::orcus_xml& rFilter) : mrFilter(rFilter) {} - void operator() (const OString& rPath) - { - mrFilter.append_field_link(rPath.getStr()); - } -}; - void loadContentFromURL(const OUString& rURL, std::string& rStrm) { ucbhelper::Content aContent( @@ -274,7 +263,12 @@ void ScOrcusXMLContextImpl::importXML(const ScOrcusImportXMLParam& rParam) OUStringToOString(aTabName, RTL_TEXTENCODING_UTF8).getStr(), rLink.maPos.Row(), rLink.maPos.Col()); - std::for_each(rLink.maFieldPaths.begin(), rLink.maFieldPaths.end(), InsertFieldPath(filter)); + std::for_each(rLink.maFieldPaths.begin(), rLink.maFieldPaths.end(), + [&filter](const OString& rFieldPath) + { + filter.append_field_link(rFieldPath.getStr()); + } + ); std::for_each(rLink.maRowGroups.begin(), rLink.maRowGroups.end(), [&filter] (const OString& rRowGroup) -- cgit