Project: SWT
Bug 118362 StyledText: Top index wrong after selectAll
Reported: 2005-11-29 00:02:00 | Status: resolved fixed

SWT-win32, N20051127-0010 - Run the testcase below - Expected result: both text lines are visible - Actual result: the first line is scrolled out of view - Does not happen in v3138-v3214 --- import org.eclipse.swt.*; import org.eclipse.swt.custom.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class StyledTextSelectAllTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); StyledText text = new StyledText( shell, SWT.WRAP | SWT.MULTI | SWT.V_SCROLL); text.setText("First line\r\nSecond line"); text.selectAll(); shell.setSize(200, 200); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java