summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-03-18 16:23:04 +0000
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-19 13:40:22 -0400
commit6000c8d15510b77a02d517afb81e3d2e164b318c (patch)
tree130cfcfac528874c3a27260a324d1de0ce9ef567 /sc
parent02478afbd86a595dd87f4303e3c8a5ce0f522fcf (diff)
re-build formula groups inside Interpret instead.
Change-Id: Ied1b82011b88f4eacfd5285176f58bf56c057f67
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx1
-rw-r--r--sc/inc/table.hxx1
-rw-r--r--sc/source/core/data/cell.cxx5
-rw-r--r--sc/source/core/data/column3.cxx4
-rw-r--r--sc/source/core/data/documen9.cxx8
-rw-r--r--sc/source/core/data/table6.cxx6
6 files changed, 25 insertions, 0 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 175bf148cc10..4dc0602da26d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1684,6 +1684,7 @@ public:
SC_DLLPUBLIC void CalcFormulaTree(
bool bOnlyForced = false, bool bProgressBar = true, bool bSetAllDirty = true );
void ClearFormulaTree();
+ void RebuildFormulaGroups();
void AppendToFormulaTrack( ScFormulaCell* pCell );
void RemoveFromFormulaTrack( ScFormulaCell* pCell );
void TrackFormulas( sal_uLong nHintId = SC_HINT_DATACHANGED );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 25f4f7a782d0..6a0b07880fd4 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -882,6 +882,7 @@ private:
void CompileDBFormula( bool bCreateFormulaString );
void CompileNameFormula( bool bCreateFormulaString );
void CompileColRowNameFormula();
+ void RebuildFormulaGroups();
void StartListening( const ScAddress& rAddress, SvtListener* pListener );
void EndListening( const ScAddress& rAddress, SvtListener* pListener );
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index a7133c29d13e..c2247c108b64 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1193,6 +1193,11 @@ void ScFormulaCell::Interpret()
if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn())
return; // no double/triple processing
+ // Re-build formulae groups - ideally this is done at import / insert / delete etc.
+ // and is reflected in the dependency data ...
+ pDocument->RebuildFormulaGroups();
+
+
//! HACK:
// If the call originates from a Reschedule in DdeLink update, leave dirty
// Better: Do a Dde Link Update without Reschedule or do it completely asynchronously!
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 5ddb3f1287ff..d288625a318a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2036,6 +2036,7 @@ void ScColumn::RebuildFormulaGroups()
ScFormulaCell *pCur = static_cast< ScFormulaCell *>( rCur.pCell );
ScFormulaCell *pPrev = static_cast< ScFormulaCell *>( rPrev.pCell );
+#ifdef BUILD_FORMULA_GROUPS
fprintf( stderr, "column has contiguous formulae\n" );
ScSimilarFormulaDelta *pDelta = pPrev->BuildDeltaTo( pCur );
@@ -2080,6 +2081,9 @@ void ScColumn::RebuildFormulaGroups()
pCur->ReleaseDelta( pDelta );
}
+#else
+ (void)pCur; (void) pPrev;
+#endif
}
bDirtyGroups = false;
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index b0214b1e571b..4a261e8e9006 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -695,4 +695,12 @@ void ScDocument::ApplyAsianEditSettings( ScEditEngineDefaulter& rEngine )
rEngine.SetKernAsianPunctuation( GetAsianKerning() );
}
+void ScDocument::RebuildFormulaGroups()
+{
+ SCTAB nTab;
+ for (nTab=0; nTab < static_cast<SCTAB>(maTabs.size()); nTab++)
+ if (maTabs[nTab])
+ maTabs[nTab]->RebuildFormulaGroups();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 8206cd841537..f4a5d25721df 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1027,4 +1027,10 @@ bool ScTable::SearchRangeForAllEmptyCells(
return bFound;
}
+void ScTable::RebuildFormulaGroups()
+{
+ for (SCCOL i=0; i<=MAXCOL; i++)
+ aCol[i].RebuildFormulaGroups();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */