[Libreoffice-commits] core.git: sc/source

Kohei Yoshida (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 27 21:21:10 UTC 2019


 sc/source/filter/orcus/xmlcontext.cxx |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 5c59051deb1b1294b3a6985bc753d639bf943fae
Author:     Kohei Yoshida <kohei at libreoffice.org>
AuthorDate: Tue Aug 27 14:05:20 2019 -0400
Commit:     Kohei Yoshida <kohei at libreoffice.org>
CommitDate: Tue Aug 27 23:19:27 2019 +0200

    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 <kohei at libreoffice.org>

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)


More information about the Libreoffice-commits mailing list