Community
Participate
Working Groups
3.6 RC4 1. Run the snippet 2. Press End (cause the table to show the last item) 3. Select an item, Press Del (deletes the select item) Note item at the selected index shows empty, the item at index + 1 shows the old text, the item at itemCount - 1 shows the old text.
Test case: import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class PR316806 { public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); final Table table = new Table(shell, SWT.BORDER |SWT.MULTI | SWT.FULL_SELECTION); for (int j = 0; j < 400; j++) { TableItem item = new TableItem(table, SWT.NONE); item.setText("item" + j); } table.addListener(SWT.KeyDown, new Listener() { public void handleEvent(Event event) { if(event.character == SWT.DEL){ int index = table.getSelectionIndex(); if (index != -1) { table.remove(index); } } } }); shell.setLayout(new FillLayout()); shell.setSize(200, 600); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
Created attachment 171966 [details] patch Patch for this problem and includes the fix for 316813. Note: Need test on vista and xp for virtual and non virtual table. Tested on windows 7.
Fixed in HEAD > 20100813 Silenio, I feel this fix might be too dangerous for 3.6.1. I'm fixing it only in HEAD. Agreed ?
At least we should wait until the code gets tested.