Kaydet (Commit) e5988f2f authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Caolán McNamara

Resolves: tdf#84762 collect all recalc-always cells before setting any dirty

Change-Id: I38f69bcbb9eb550fb97b0f84bc0cb486863060b4
(cherry picked from commit bf35419b)
Reviewed-on: https://gerrit.libreoffice.org/16873Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e7352d5a
...@@ -419,6 +419,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet ...@@ -419,6 +419,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
CalcAll(); CalcAll();
else else
{ {
::std::vector<ScFormulaCell*> vAlwaysDirty;
ScFormulaCell* pCell = pFormulaTree; ScFormulaCell* pCell = pFormulaTree;
while ( pCell ) while ( pCell )
{ {
...@@ -428,12 +429,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet ...@@ -428,12 +429,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet
{ {
if ( pCell->GetCode()->IsRecalcModeAlways() ) if ( pCell->GetCode()->IsRecalcModeAlways() )
{ {
// pCell is set to Dirty again! // pCell and dependents are to be set dirty again, collect
ScFormulaCell* pNext = pCell->GetNext(); // them first and broadcast afterwards to not break the
pCell->SetDirty(); // FormulaTree chain here.
// if pNext==0 and new dependencies were appended at the end, vAlwaysDirty.push_back( pCell);
// this does not matter since they all are bDirty pCell = pCell->GetNext();
pCell = pNext;
} }
else else
{ // calculate the other single { // calculate the other single
...@@ -443,6 +443,14 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet ...@@ -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; bool bProgress = !bOnlyForced && nFormulaCodeInTree && bProgressBar;
if ( bProgress ) if ( bProgress )
ScProgress::CreateInterpretProgress( this, true ); ScProgress::CreateInterpretProgress( this, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment