Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXi Yan2019-04-08 20:10:20 +0000
committerEric Williams2019-04-09 13:52:39 +0000
commit5187ed6e90f2808173b79f3968ac66987ac4128e (patch)
treed6015be01f8b9c19851352828a727f8e1a6e71a4
parent1ee3d555ab6560344fa2a0560f3da3fe602db657 (diff)
downloadeclipse.platform.swt-5187ed6e90f2808173b79f3968ac66987ac4128e.tar.gz
eclipse.platform.swt-5187ed6e90f2808173b79f3968ac66987ac4128e.tar.xz
eclipse.platform.swt-5187ed6e90f2808173b79f3968ac66987ac4128e.zip
Bug 546211 - [GTK3] Disposing TableItem should not scroll table
Apply same fix as bug 545994 for disposing TableItem. Change-Id: Iaeeadaf8c2752b1a4fef1dcbeb87190c577f98d4 Signed-off-by: Xi Yan <xixiyan@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index ec101454c6..98eb2bf54e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -242,11 +242,12 @@ void destroyWidget () {
@Override
public void dispose () {
// Workaround to Bug489751, avoid selecting next node when selected node is disposed.
+ Table tmpParent = null;
if (parent != null && parent.getItemCount() > 0 && parent.getSelectionCount() == 0) {
- parent.setSelection(parent.getItem(0));
- parent.deselectAll();
+ tmpParent = parent;
}
super.dispose();
+ if (tmpParent != null && !tmpParent.isDisposed()) tmpParent.deselectAll();
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index f984669b5f..8427b1b41d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -1099,7 +1099,7 @@ public void dispose () {
tmpParent = parent;
}
super.dispose();
- if (tmpParent != null) tmpParent.deselectAll();
+ if (tmpParent != null && !tmpParent.isDisposed()) tmpParent.deselectAll();
}
/**

Back to the top