diff options
author | Knut Radloff <kradloff> | 2002-05-03 21:55:58 +0000 |
---|---|---|
committer | Knut Radloff <kradloff> | 2002-05-03 21:55:58 +0000 |
commit | 30be2a8eb4dab80d5507aa7107894819cb507294 (patch) | |
tree | 49dbadb8e5528b401c7b9e98351128cf07eb478b | |
parent | 7032b92e92c3cea689dbe88eb8141f384dc52202 (diff) | |
download | eclipse.platform.swt-30be2a8eb4dab80d5507aa7107894819cb507294.tar.gz eclipse.platform.swt-30be2a8eb4dab80d5507aa7107894819cb507294.tar.xz eclipse.platform.swt-30be2a8eb4dab80d5507aa7107894819cb507294.zip |
fixes bug 14935
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java index b4d23585cb..98f65e5d5a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/emulated/treetable/org/eclipse/swt/widgets/Table.java @@ -1741,6 +1741,7 @@ public void remove(int indices[]) { SelectableItem item;
int [] sortedIndices;
int last = -1;
+ int sortedIndex;
if (indices == null) {
error(SWT.ERROR_NULL_ARGUMENT);
@@ -1749,15 +1750,21 @@ public void remove(int indices[]) { System.arraycopy (indices, 0, sortedIndices, 0, indices.length);
sort(sortedIndices); // sort indices in descending order
for (int i = 0; i < sortedIndices.length; i++) {
- if (sortedIndices[i] != last) {
- item = getVisibleItem(sortedIndices[i]);
+ sortedIndex = sortedIndices[i];
+ if (sortedIndex != last) {
+ item = getVisibleItem(sortedIndex);
if (item != null) {
item.dispose();
}
else {
- error(SWT.ERROR_ITEM_NOT_REMOVED);
+ if (0 <= sortedIndex && sortedIndex < getItemVector().size()) {
+ error(SWT.ERROR_ITEM_NOT_REMOVED);
+ }
+ else {
+ error(SWT.ERROR_INVALID_RANGE);
+ }
}
- last = sortedIndices[i];
+ last = sortedIndex;
}
}
}
@@ -1786,7 +1793,12 @@ public void remove(int index) { item.dispose();
}
else {
- error(SWT.ERROR_ITEM_NOT_REMOVED);
+ if (0 <= index && index < getItemVector().size()) {
+ error(SWT.ERROR_ITEM_NOT_REMOVED);
+ }
+ else {
+ error(SWT.ERROR_INVALID_RANGE);
+ }
}
}
/**
|