Project: SWT
Bug 201326 computeSize on empty Link widget returns 0 for height
Reported: 2007-08-27 16:56:34 | Status: resolved fixed

3.3 Point p = new Label(parent, SWT.NONE).computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println(p); p = new Link(parent, SWT.NONE).computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println(p); This prints out: Point {0, 13} Point {0, 0} Expectation: the preferred height of an empty Link widget should be the font height (or more perhaps if the underline takes space). Otherwise, the usual approach of using SWT.CENTER for the vertical alignment in GridData fails -- it gets a height of 0. We're using a workaround of setting a height hint based on the height of the font.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java