From e091657eafa69252ce0777b83d6ef7560dacfd3b Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Thu, 5 May 2016 12:59:48 +0100 Subject: [PATCH] Bug 493070: [GTK3] stop removing all items from list in GTK3 when the current selection is removed from the org.eclipse.swt.widgets.List the selection is updated to another item, on GTK2 and Windows the list stops having a selection. This change updates the code to safely delete all selected items. Change-Id: Iedc99db89af117a04ad163190bdda0f8720eb2a6 Signed-off-by: Jonah Graham --- .../org/eclipse/cdt/utils/ui/controls/FileListControl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java index f6c5da0805c..4659faa417d 100644 --- a/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java +++ b/core/org.eclipse.cdt.ui/utils.ui/org/eclipse/cdt/utils/ui/controls/FileListControl.java @@ -872,9 +872,7 @@ public class FileListControl { delDir = MessageDialog.openQuestion(list.getShell(), title, quest); } if (delDir){ - int i; - while ((i = list.getSelectionIndex()) != -1) - list.remove(i); + list.remove(list.getSelectionIndices()); checkNotificationNeeded(); } selectionChanged();