Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java12
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java8
2 files changed, 6 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index bb4f2c1937..456e338987 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -2589,9 +2589,7 @@ void destroyItem (TreeItem item, long hItem) {
*/
// OS.SendMessage (handle, OS.WM_SETREDRAW, 0, 0);
}
- if ((style & SWT.MULTI) != 0) {
- ignoreDeselect = ignoreSelect = lockSelection = true;
- }
+ ignoreDeselect = ignoreSelect = lockSelection = true;
/*
* Feature in Windows. When an item is deleted and a tool tip
@@ -2609,9 +2607,11 @@ void destroyItem (TreeItem item, long hItem) {
shrink = ignoreShrink = true;
OS.SendMessage (handle, OS.TVM_DELETEITEM, 0, hItem);
ignoreShrink = false;
- if ((style & SWT.MULTI) != 0) {
- ignoreDeselect = ignoreSelect = lockSelection = false;
- }
+ /*
+ * Bug 546333: When TVGN_CARET item is deleted, Windows automatically
+ * sets selection to some other item. We do not want that.
+ */
+ ignoreDeselect = ignoreSelect = lockSelection = false;
if (fixRedraw) {
OS.DefWindowProc (handle, OS.WM_SETREDRAW, 1, 0);
OS.ValidateRect (handle, null);
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
index 3485390f67..48bfb9d6b9 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java
@@ -845,14 +845,6 @@ public void test_consistency_DragDetect () {
@Test
public void test_disposeItemNotTriggerSelection() {
- if (SwtTestUtil.isWindows) {
- // TODO Fix Windows failure.
- if (SwtTestUtil.verbose) {
- System.out
- .println("Excluded test_disposeItemNotTriggerSelection(org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Tree).");
- }
- return;
- }
Display display = shell.getDisplay();
shell.setLayout(new FillLayout());
Tree tree = new Tree (shell, SWT.BORDER);

Back to the top