sc/source/core/data/document.cxx | 25 +++++++++++++++++++++---- sc/source/core/data/formulacell.cxx | 2 -- 2 files changed, 21 insertions(+), 6 deletions(-)
New commits: commit abe96a930dcc267b1468a15b1eb2df2b3d06a509 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Tue Nov 18 21:03:05 2014 -0500 Use group area listeners during ODS import. Change-Id: Id01f9021dda7f33255f8206174cd730507ab55ad diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index fe4cba1..40a4672 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3676,6 +3676,25 @@ void ScDocument::CompileAll() SetAllFormulasDirty(aFormulaDirtyCxt); } +namespace { + +class CompileXMLHandler : 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(); @@ -3692,10 +3711,8 @@ void ScDocument::CompileXML() if (pRangeName) pRangeName->CompileUnresolvedXML(aCxt); - TableContainer::iterator it = maTabs.begin(); - for (; it != maTabs.end(); ++it) - if (*it) - (*it)->CompileXML(aCxt, aProgress); + std::for_each(maTabs.begin(), maTabs.end(), CompileXMLHandler(aCxt, aProgress)); + StartAllListeners(); DELETEZ( pAutoNameCache ); // valid only during CompileXML, where cell contents don't change diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index ea08c1a..a4f8944 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1222,7 +1222,6 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr bSubTotal = pPreviousCell->bSubTotal; bChanged = true; bCompile = false; - StartListeningTo( pDocument ); if (bSubTotal) pDocument->AddSubTotalCell(this); @@ -1257,7 +1256,6 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr nFormatType = aComp.GetNumFormatType(); bChanged = true; bCompile = false; - StartListeningTo( pDocument ); } if (bSubTotal) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits