summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen4.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-04 10:19:47 -0500
committerFridrich Strba <fridrich@documentfoundation.org>2014-02-06 14:37:10 +0000
commit99a835ca644d69241cba9d7e4c4a315a4a3ea652 (patch)
tree6f5a05825df489ec953490772bbaeda81e30e63b /sc/source/core/data/documen4.cxx
parent8e8827a2d092810394c819c536d48b74080abce8 (diff)
fdo#74516: Avoid excessive building of escaped sheet names.
The old code would build an array of escaped sheet names for all sheets on evevery invokation of ScCompiler, which unfortunately slowed down these "compile all formula cells" type methods, such as CompileAll(), CompileXML() etc. Let's avoid that and build or re-build the list only when necessary. Conflicts: sc/inc/column.hxx sc/inc/table.hxx sc/source/core/data/document.cxx sc/source/core/tool/compiler.cxx Change-Id: Iabf7c2374b728b6701da3aae7835cca2157f6c96 Reviewed-on: https://gerrit.libreoffice.org/7861 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc/source/core/data/documen4.cxx')
-rw-r--r--sc/source/core/data/documen4.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index ed496961c38b..fb4538581c73 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -44,6 +44,7 @@
#include "formulacell.hxx"
#include "tokenarray.hxx"
#include "scmatrix.hxx"
+#include <tokenstringcontext.hxx>
using namespace formula;
@@ -538,41 +539,45 @@ bool ScDocument::ReplaceStyle(const SvxSearchItem& rSearchItem,
void ScDocument::CompileDBFormula()
{
+ sc::CompileFormulaContext aCxt(this);
TableContainer::iterator it = maTabs.begin();
for (;it != maTabs.end(); ++it)
{
if (*it)
- (*it)->CompileDBFormula();
+ (*it)->CompileDBFormula(aCxt);
}
}
void ScDocument::CompileDBFormula( bool bCreateFormulaString )
{
+ sc::CompileFormulaContext aCxt(this);
TableContainer::iterator it = maTabs.begin();
for (;it != maTabs.end(); ++it)
{
if (*it)
- (*it)->CompileDBFormula( bCreateFormulaString );
+ (*it)->CompileDBFormula(aCxt, bCreateFormulaString);
}
}
void ScDocument::CompileNameFormula( bool bCreateFormulaString )
{
+ sc::CompileFormulaContext aCxt(this);
TableContainer::iterator it = maTabs.begin();
for (;it != maTabs.end(); ++it)
{
if (*it)
- (*it)->CompileNameFormula( bCreateFormulaString );
+ (*it)->CompileNameFormula(aCxt, bCreateFormulaString);
}
}
void ScDocument::CompileColRowNameFormula()
{
+ sc::CompileFormulaContext aCxt(this);
TableContainer::iterator it = maTabs.begin();
for (;it != maTabs.end(); ++it)
{
if (*it)
- (*it)->CompileColRowNameFormula();
+ (*it)->CompileColRowNameFormula(aCxt);
}
}