File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/plugins/ui_core_views/cell_evaluation Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,8 @@ export class Evaluator {
410410 private invalidatePositionsDependingOnSpread ( sheetId : UID , resultZone : Zone ) {
411411 // the result matrix is split in 2 zones to exclude the array formula position
412412 const invalidatedPositions = this . formulaDependencies ( ) . getCellsDependingOn (
413- excludeTopLeft ( resultZone ) . map ( ( zone ) => ( { sheetId, zone } ) )
413+ excludeTopLeft ( resultZone ) . map ( ( zone ) => ( { sheetId, zone } ) ) ,
414+ this . nextPositionsToUpdate
414415 ) ;
415416 invalidatedPositions . delete ( { sheetId, col : resultZone . left , row : resultZone . top } ) ;
416417 this . nextPositionsToUpdate . addMany ( invalidatedPositions ) ;
@@ -571,7 +572,7 @@ export class Evaluator {
571572 for ( const sheetId in zonesBySheetIds ) {
572573 ranges . push ( ...zonesBySheetIds [ sheetId ] . map ( ( zone ) => ( { sheetId, zone } ) ) ) ;
573574 }
574- return this . formulaDependencies ( ) . getCellsDependingOn ( ranges ) ;
575+ return this . formulaDependencies ( ) . getCellsDependingOn ( ranges , this . nextPositionsToUpdate ) ;
575576 }
576577}
577578
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export class FormulaDependencyGraph {
5858 * in the correct order they should be evaluated.
5959 * This is called a topological ordering (excluding cycles)
6060 */
61- getCellsDependingOn ( ranges : RTreeBoundingBox [ ] ) : PositionSet {
61+ getCellsDependingOn ( ranges : RTreeBoundingBox [ ] , ignore : PositionSet ) : PositionSet {
6262 const visited = this . createEmptyPositionSet ( ) ;
6363 const queue : RTreeBoundingBox [ ] = Array . from ( ranges ) . reverse ( ) ;
6464 while ( queue . length > 0 ) {
@@ -74,7 +74,7 @@ export class FormulaDependencyGraph {
7474 const impactedPositions = this . rTree . search ( range ) . map ( ( dep ) => dep . data ) ;
7575 const nextInQueue : Record < UID , Zone [ ] > = { } ;
7676 for ( const position of impactedPositions ) {
77- if ( ! visited . has ( position ) ) {
77+ if ( ! visited . has ( position ) && ! ignore . has ( position ) ) {
7878 if ( ! nextInQueue [ position . sheetId ] ) {
7979 nextInQueue [ position . sheetId ] = [ ] ;
8080 }
You can’t perform that action at this time.
0 commit comments