summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-07-09 00:18:04 +0200
committerEike Rathke <erack@redhat.com>2015-07-09 02:14:22 +0200
commitbf35419b68d7f100a634572236f7d593638981c8 (patch)
tree865c6fdda94ffb0292ed1a3e4f4fcf3772a0066e /sc
parentd3b6f3790953bdfeaeebcd3ba9ec370d94ca4ebf (diff)
Resolves: tdf#84762 collect all recalc-always cells before setting any dirty
Change-Id: I38f69bcbb9eb550fb97b0f84bc0cb486863060b4
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen7.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index d89ea62aac82..b67cce9f6b2e 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -419,6 +419,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
CalcAll();
else
{
+ ::std::vector<ScFormulaCell*> vAlwaysDirty;
ScFormulaCell* pCell = pFormulaTree;
while ( pCell )
{
@@ -428,12 +429,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
{
if ( pCell->GetCode()->IsRecalcModeAlways() )
{
- // pCell is set to Dirty again!
- ScFormulaCell* pNext = pCell->GetNext();
- pCell->SetDirty();
- // if pNext==0 and new dependencies were appended at the end,
- // this does not matter since they all are bDirty
- pCell = pNext;
+ // pCell and dependents are to be set dirty again, collect
+ // them first and broadcast afterwards to not break the
+ // FormulaTree chain here.
+ vAlwaysDirty.push_back( pCell);
+ pCell = pCell->GetNext();
}
else
{ // calculate the other single
@@ -443,6 +443,14 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
}
}
}
+ for (::std::vector<ScFormulaCell*>::iterator it( vAlwaysDirty.begin()), itEnd( vAlwaysDirty.end());
+ it != itEnd; ++it)
+ {
+ pCell = *it;
+ if (!pCell->GetDirty())
+ pCell->SetDirty();
+ }
+
bool bProgress = !bOnlyForced && nFormulaCodeInTree && bProgressBar;
if ( bProgress )
ScProgress::CreateInterpretProgress( this, true );