Project: SWT
Bug 199115 Table.computeSize wrong when table has no columns
Reported: 2007-08-07 12:43:29 | Status: resolved fixed

computeSize is wrong when it's called before the table is visible. test case: public static void main(String[] args) { Display display = new Display (); Shell shell = new Shell (display); final Table table = new Table (shell, SWT.NONE); TableItem item = new TableItem (table, SWT.NONE); item.setText("plate"); Point size = table.computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println(size); table.setSize(size); shell.open (); size = table.computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println(size); // table.setSize(size); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose(); }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/wpf/org/eclipse/swt/internal/wpf/OS.java bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Table.java bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/TableItem.java bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Widget.java