summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-07-09 00:18:04 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2015-07-10 14:32:34 +0000
commitb5c3895505d506cef4ee1fb81280a4bcaf070067 (patch)
treef1b474f9bef7e2ff6dd7f26dda02eb6e87997f74
parent7294c12893cbc9d9e4779e8dac7ad69b617adf47 (diff)
Resolves: tdf#84762 collect all recalc-always cells before setting any dirty
(cherry picked from commit bf35419b68d7f100a634572236f7d593638981c8) Conflicts: sc/source/core/data/documen7.cxx Change-Id: I38f69bcbb9eb550fb97b0f84bc0cb486863060b4 Reviewed-on: https://gerrit.libreoffice.org/16874 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-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 6429fa53267c..ea06c2a0faae 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -410,6 +410,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
CalcAll();
else
{
+ ::std::vector<ScFormulaCell*> vAlwaysDirty;
ScFormulaCell* pCell = pFormulaTree;
while ( pCell )
{
@@ -419,12 +420,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
{
if ( pCell->GetCode()->IsRecalcModeAlways() )
{
- // pCell wird im SetDirty neu angehaengt!
- ScFormulaCell* pNext = pCell->GetNext();
- pCell->SetDirty();
- // falls pNext==0 und neue abhaengige hinten angehaengt
- // wurden, so macht das nichts, da die alle bDirty sind
- 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
{ // andere simpel berechnen
@@ -434,6 +434,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 );