Kaydet (Commit) 573f5dfb authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: fdo#86978 append formula cells to track instead of tree

Cells in FormulaTree are assumed to be tracked already and their
dependents be notified. Also postpone tracking until all listeners are
established.

Change-Id: I7f27fba979fe231e3d3cd071fcc8a273142cb3f3
üst 87561f10
...@@ -3764,6 +3764,10 @@ void ScDocument::CompileXML() ...@@ -3764,6 +3764,10 @@ void ScDocument::CompileXML()
if ( pValidationList ) if ( pValidationList )
pValidationList->CompileXML(); pValidationList->CompileXML();
// Track all formula cells that were appended to the FormulaTrack during
// import or CompileXML().
TrackFormulas();
SetAutoCalc( bOldAutoCalc ); SetAutoCalc( bOldAutoCalc );
} }
......
...@@ -1330,7 +1330,9 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr ...@@ -1330,7 +1330,9 @@ void ScFormulaCell::CompileXML( sc::CompileFormulaContext& rCxt, ScProgress& rPr
// During load, only those cells that are marked explicitly dirty get // During load, only those cells that are marked explicitly dirty get
// recalculated. So we need to set it dirty here. // recalculated. So we need to set it dirty here.
SetDirtyVar(); SetDirtyVar();
pDocument->PutInFormulaTree(this); pDocument->AppendToFormulaTrack(this);
// Do not call TrackFormulas() here, not all listeners may have been
// established, postponed until ScDocument::CompileXML() finishes.
} }
else if (bWasInFormulaTree) else if (bWasInFormulaTree)
pDocument->PutInFormulaTree(this); pDocument->PutInFormulaTree(this);
...@@ -2135,7 +2137,14 @@ void ScFormulaCell::SetDirty( bool bDirtyFlag ) ...@@ -2135,7 +2137,14 @@ void ScFormulaCell::SetDirty( bool bDirtyFlag )
if( bDirtyFlag ) if( bDirtyFlag )
SetDirtyVar(); SetDirtyVar();
pDocument->AppendToFormulaTrack( this ); pDocument->AppendToFormulaTrack( this );
pDocument->TrackFormulas();
// While loading a document listeners have not been established yet.
// Tracking would remove this cell from the FormulaTrack and add it to
// the FormulaTree, once in there it would be assumed that its
// dependents already had been tracked and it would be skipped on a
// subsequent notify. Postpone tracking until all listeners are set.
if (!pDocument->IsImportingXML())
pDocument->TrackFormulas();
} }
pDocument->SetStreamValid(aPos.Tab(), false); pDocument->SetStreamValid(aPos.Tab(), false);
......
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