diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2016-10-02 20:31:48 -0400 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2016-10-03 11:41:41 +0000 |
commit | e86e96a32dcf551f2f103d149214306d26ea0238 (patch) | |
tree | 437bcdfc9bab5bc84d692e50f2346c5efc890e5e /sc | |
parent | a31378fa043c72770aa7457c4e03194de8b3bab5 (diff) |
Use closure to simplify use of for_each.
Change-Id: I4bca7bec32e194418b811244cbfb8a3ab4c0cdfa
Reviewed-on: https://gerrit.libreoffice.org/29465
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document.cxx | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 415c3e647d51..b5083ab71629 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3898,25 +3898,6 @@ void ScDocument::CompileAll() SetAllFormulasDirty(aFormulaDirtyCxt); } -namespace { - -class CompileXMLHandler : public std::unary_function<ScTable*, void> -{ - sc::CompileFormulaContext* mpCxt; - ScProgress* mpProgress; -public: - CompileXMLHandler( sc::CompileFormulaContext& rCxt, ScProgress& rProgress ) : - mpCxt(&rCxt), mpProgress(&rProgress) {} // Take pointers to make it copyable. - - void operator() ( ScTable* pTab ) - { - if (pTab) - pTab->CompileXML(*mpCxt, *mpProgress); - } -}; - -} - void ScDocument::CompileXML() { bool bOldAutoCalc = GetAutoCalc(); @@ -3933,7 +3914,13 @@ void ScDocument::CompileXML() if (pRangeName) pRangeName->CompileUnresolvedXML(aCxt); - std::for_each(maTabs.begin(), maTabs.end(), CompileXMLHandler(aCxt, aProgress)); + std::for_each(maTabs.begin(), maTabs.end(), + [&](ScTable* pTab) + { + if (pTab) + pTab->CompileXML(aCxt, aProgress); + } + ); StartAllListeners(); DELETEZ( pAutoNameCache ); // valid only during CompileXML, where cell contents don't change |