Skip to content

Commit d994b40

Browse files
raghucssitiloveeclipse
authored andcommitted
Fix italic left over by the Show node.
As we set italic font to Show item updating the item with new element left behind it's font. Now destroy the Show item and create items from it's position onwards. (No impact on performance - previous performance data matches with the fix) Fixes #1032
1 parent 8af2092 commit d994b40

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,15 +478,13 @@ void handleExpandableNodeClicked(Widget w) {
478478
Object[] nextChildren = applyItemsLimit(data, sortedChildren);
479479

480480
if (nextChildren.length > 0) {
481-
// update the expandable node with first item.
482-
doUpdateItem(item, nextChildren[0], true);
483-
// create remaining elements
484-
if (nextChildren.length > 1) {
485-
// current index is updated so start creating from next index.
486-
int index = doIndexOf(item) + 1;
487-
for (int i = 1; i < nextChildren.length; i++) {
488-
createItem(nextChildren[i], index++);
489-
}
481+
disassociate(item);
482+
int index = doIndexOf(item);
483+
// will also call item.dispose()
484+
doRemove(new int[] { index });
485+
486+
for (int i = 0; i < nextChildren.length; i++) {
487+
createItem(nextChildren[i], index++);
490488
}
491489
// If we've expanded but still have not reached the limit
492490
// select new expandable node, so user can click through

bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeViewer.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,13 @@ void handleExpandableNodeClicked(Widget w) {
11591159
parent = getControl();
11601160
}
11611161

1162-
// update widget
1163-
updateItem(item, children[0]);
1164-
updatePlus(item, children[0]);
1165-
1166-
if (children.length > 1) {
1167-
// create children on parent
1168-
for (int i = 1; i < children.length; i++) {
1169-
createTreeItem(parent, children[i], -1);
1170-
}
1162+
// destroy widget
1163+
disassociate(item);
1164+
item.dispose();
1165+
1166+
// create children on parent
1167+
for (Object element : children) {
1168+
createTreeItem(parent, element, -1);
11711169
}
11721170

11731171
// If we've expanded but still have not reached the limit

0 commit comments

Comments
 (0)