Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
index 8b22fe318f..40dfa25432 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -2232,7 +2232,7 @@ public void remove (int start, int end) {
if (start == 0 && end == itemCount - 1) {
removeAll ();
} else {
- int length = end - start + 1;
+ int numOfItemsRemoved = end - start + 1;
for (int i=start; i<=end; i++) {
TableItem item = items [i];
if (item != null) item.release (false);
@@ -2249,7 +2249,7 @@ public void remove (int start, int end) {
int newIndex = newCount++;
selection [newIndex] = selection [i];
if (selection [newIndex] > end) {
- selection [newIndex] -= length;
+ selection [newIndex] -= numOfItemsRemoved;
fix = true;
}
}
@@ -2257,11 +2257,11 @@ public void remove (int start, int end) {
if (fix) select (selection, newCount, true);
}
//fix items array
- System.arraycopy (items, start + length, items, start, itemCount - (start + length));
- for (int i = itemCount; i < items.length; i++) {
+ System.arraycopy (items, start + numOfItemsRemoved, items, start, itemCount - (start + numOfItemsRemoved));
+ for (int i = itemCount - numOfItemsRemoved; i < itemCount; i++) {
items [i] = null;
}
- itemCount -= length;
+ itemCount -= numOfItemsRemoved;
updateRowCount();
}
if (itemCount == 0) {

Back to the top