Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316806 - refresh problem in table on windows vista
Summary: refresh problem in table on windows vista
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.7   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 316813
  Show dependency tree
 
Reported: 2010-06-14 15:04 EDT by Felipe Heidrich CLA
Modified: 2010-08-18 11:37 EDT (History)
2 users (show)

See Also:


Attachments
patch (3.51 KB, patch)
2010-06-15 13:24 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.