summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-08-14 12:34:20 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-08-14 19:25:42 -0400
commit5dd2e45e65641134309265db30c9d5f304d0a583 (patch)
tree196c80fb7ae82a85b18d19b56a4f3d13fb3a8ea7 /sc/source/core/data
parent25763e59625ce83de4b82927359108f9e7878744 (diff)
Avoid wholesale rebuilding of formula groups at re-calc time.
And do it once when importing xls, xlsx, and ods documents. Although xls(x) file formats support shared formula natively, it's still beneficial to re-group it as some old xls documents limit the length of shared formula span to only 64, or some don't use shared formulas at all even though they could. And re-grouping just once is not terribly expensive. Change-Id: Iff9c605d19baa187553ddab6af8b9fbd4c366d7d
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column3.cxx11
-rw-r--r--sc/source/core/data/documentimport.cxx1
-rw-r--r--sc/source/core/data/formulacell.cxx4
-rw-r--r--sc/source/core/data/table6.cxx2
4 files changed, 2 insertions, 16 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 0ac06e7e4726..b452b68b17ed 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2742,17 +2742,6 @@ public:
}
-// Very[!] slow way to look for and merge contiguous runs
-// of similar formulae into a formulagroup
-void ScColumn::RebuildFormulaGroups()
-{
- if (!mbDirtyGroups)
- return;
-
- RegroupFormulaCells();
- mbDirtyGroups = false;
-}
-
void ScColumn::RegroupFormulaCells()
{
// re-build formula groups.
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 1c368b404d45..d3dd4dbcb97b 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -353,6 +353,7 @@ void ScDocumentImport::initColumn(ScColumn& rCol)
CellTextAttrInitializer aFunc(mpImpl->mnDefaultScriptNumeric);
std::for_each(rCol.maCells.begin(), rCol.maCells.end(), aFunc);
aFunc.swap(rCol.maCellTextAttrs);
+ rCol.RegroupFormulaCells();
rCol.CellStorageModified();
}
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index f40e5a53bde5..a7491a224ffb 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3510,10 +3510,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
if (!ScInterpreter::GetGlobalConfig().mbOpenCLEnabled)
return false;
- // Re-build formulae groups if necessary - ideally this is done at
- // import / insert / delete etc. and is integral to the data structures
- pDocument->RebuildFormulaGroups();
-
if (!mxGroup || !pCode)
return false;
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 540eb55dc17b..3f23fa0c0500 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1029,7 +1029,7 @@ bool ScTable::SearchRangeForAllEmptyCells(
void ScTable::RebuildFormulaGroups()
{
for (SCCOL i=0; i<=MAXCOL; i++)
- aCol[i].RebuildFormulaGroups();
+ aCol[i].RegroupFormulaCells();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */