diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java | 6 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 7c475acee0..5edfc18fec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -621,15 +621,15 @@ public int getSelectionIndex () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { OS.memmove (index, indices, 4); - for (int j = i + 1; j < count; j++) { + for (int j = i; j < count; j++) { data = OS.g_list_nth_data (list, j); OS.gtk_tree_path_free (data); } break; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); return index [0]; @@ -680,13 +680,13 @@ public int [] getSelectionIndices () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { int [] index = new int [1]; OS.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); int [] result = new int [length]; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index a6ee89d464..6ce0782fe0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -1671,13 +1671,13 @@ public TableItem [] getSelection () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { int [] index = new int [1]; OS.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); TableItem [] result = new TableItem [length]; @@ -1744,15 +1744,15 @@ public int getSelectionIndex () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { OS.memmove (index, indices, 4); - for (int j = i + 1; j < count; j++) { + for (int j = i; j < count; j++) { data = OS.g_list_nth_data (list, j); OS.gtk_tree_path_free (data); } break; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); return index [0]; @@ -1802,13 +1802,13 @@ public int [] getSelectionIndices () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { int [] index = new int [1]; OS.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); int [] result = new int [length]; |