Skip to content

Commit 9ac087c

Browse files
committed
Fixes #165 - Infinite loop in performance grouping header
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
1 parent 2942c0f commit 9ac087c

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/ColumnGroupHeaderLayer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,9 @@ public void handleLayerEvent(ILayerEvent event) {
23622362
((IStructuralChangeEvent) event).isHorizontalStructureChanged()) {
23632363
IStructuralChangeEvent changeEvent = (IStructuralChangeEvent) event;
23642364
Collection<StructuralDiff> columnDiffs = changeEvent.getColumnDiffs();
2365+
2366+
boolean performUpdate = false;
2367+
23652368
if (columnDiffs != null && !columnDiffs.isEmpty()) {
23662369

23672370
int[] deletedPositions = getDeletedPositions(columnDiffs);
@@ -2379,6 +2382,8 @@ public void handleLayerEvent(ILayerEvent event) {
23792382
} else {
23802383
handleDeleteDiffs(deletedPositions);
23812384
}
2385+
2386+
performUpdate = true;
23822387
}
23832388

23842389
for (StructuralDiff diff : columnDiffs) {
@@ -2469,11 +2474,15 @@ public void handleLayerEvent(ILayerEvent event) {
24692474
doCommand(cmd);
24702475
}
24712476
}
2477+
2478+
performUpdate = true;
24722479
}
24732480
}
24742481

2475-
// update visible start positions of all groups
2476-
updateVisibleStartPositions();
2482+
if (performUpdate) {
2483+
// update visible start positions of all groups
2484+
updateVisibleStartPositions();
2485+
}
24772486
} else {
24782487
// trigger a consistency check as the details of the event
24792488
// probably where removed on converting the layer stack

org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/group/performance/RowGroupHeaderLayer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,9 @@ public void handleLayerEvent(ILayerEvent event) {
23512351
((IStructuralChangeEvent) event).isVerticalStructureChanged()) {
23522352
IStructuralChangeEvent changeEvent = (IStructuralChangeEvent) event;
23532353
Collection<StructuralDiff> rowDiffs = changeEvent.getRowDiffs();
2354+
2355+
boolean performUpdate = false;
2356+
23542357
if (rowDiffs != null && !rowDiffs.isEmpty()) {
23552358

23562359
int[] deletedPositions = getDeletedPositions(rowDiffs);
@@ -2368,6 +2371,8 @@ public void handleLayerEvent(ILayerEvent event) {
23682371
} else {
23692372
handleDeleteDiffs(deletedPositions);
23702373
}
2374+
2375+
performUpdate = true;
23712376
}
23722377

23732378
for (StructuralDiff diff : rowDiffs) {
@@ -2457,12 +2462,16 @@ public void handleLayerEvent(ILayerEvent event) {
24572462
for (UpdateRowGroupCollapseCommand cmd : collapseUpdates.values()) {
24582463
doCommand(cmd);
24592464
}
2465+
2466+
performUpdate = true;
24602467
}
24612468
}
24622469
}
24632470

2464-
// update visible start positions of all groups
2465-
updateVisibleStartPositions();
2471+
if (performUpdate) {
2472+
// update visible start positions of all groups
2473+
updateVisibleStartPositions();
2474+
}
24662475
} else {
24672476
// trigger a consistency check as the details of the event
24682477
// probably where removed on converting the layer stack

0 commit comments

Comments
 (0)