Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316806

Summary: refresh problem in table on windows vista
Product: [Eclipse Project] Platform Reporter: Felipe Heidrich <eclipse.felipe>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: a.nusser, Silenio_Quarti
Version: 3.6   
Target Milestone: 3.7   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 316813    
Attachments:
Description Flags
patch none

Description Felipe Heidrich CLA 2010-06-14 15:04:20 EDT
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.
Comment 1 Felipe Heidrich CLA 2010-06-14 15:15:53 EDT
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();
    }
}
Comment 2 Felipe Heidrich CLA 2010-06-15 13:24:02 EDT
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.
Comment 3 Felipe Heidrich CLA 2010-08-13 11:10:05 EDT
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 ?
Comment 4 Silenio Quarti CLA 2010-08-13 14:02:42 EDT
At least we should wait until the code gets tested.