| Summary: |
Table doesn't handle newline characters in cell's text on MS Windows |
| Product: |
[Eclipse Project] Platform
|
Reporter: |
Stanislav Poboril <stanislav.poboril> |
| Component: |
SWT | Assignee: |
Veronika Irvine <veronika_irvine> |
| Status: |
RESOLVED
FIXED
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
P3
|
CC: |
akurtako, billy.biggs, bpasero, fjania, francois.armand, jmesnil, Michal.Tkacz, mistria, mseele, snorthov, wojciech.galanciak
|
| Version: |
3.1 | |
|
| Target Milestone: |
--- | |
|
| Hardware: |
PC | |
|
| OS: |
Windows 98 | |
|
| Whiteboard: |
|
| Bug Depends on: |
|
|
|
| Bug Blocks: |
42263, 10716, 516949
|
|
|
Try this snippet. With Linux GTK, text is wrapped in the table, with Windows 98 SE this displays | characters instead of wrapping a line. SWT used version: 3111. import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class Main { public static void main(String[] args) { Shell shell = new Shell(); shell.setLayout(new FillLayout()); Table table = new Table(shell, SWT.NONE); table.setLinesVisible(true); table.setHeaderVisible(true); TableColumn c = new TableColumn(table, SWT.NONE); c.setWidth(200); TableItem ti1 = new TableItem(table, SWT.NONE); ti1.setText("foo\nfoo"); TableItem ti2 = new TableItem(table, SWT.NONE); ti2.setText("foo\rfoo"); TableItem ti3 = new TableItem(table, SWT.NONE); ti3.setText("foo" + System.getProperty("line.separator") + "foo"); shell.pack(); shell.open(); Display d = shell.getDisplay(); while (!shell.isDisposed()) { if (!d.readAndDispatch()) { d.sleep(); } } } }