Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 80357

Summary: Table doesn't handle newline characters in cell's text on MS Windows
Product: [Eclipse Project] Platform Reporter: Stanislav Poboril <stanislav.poboril>
Component: SWTAssignee: 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    

Description Stanislav Poboril CLA 2004-12-07 05:48:21 EST
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();
            }
        }
    }
}
Comment 1 Steve Northover CLA 2005-01-19 21:17:56 EST
Windows can't be convinced to display wrapped text.  Veronika to disable this 
feature on GTK.
Comment 2 Steve Northover CLA 2005-01-19 21:19:57 EST
*** Bug 19496 has been marked as a duplicate of this bug. ***
Comment 3 Steve Northover CLA 2007-06-14 13:22:39 EDT
We won't fix this.
Comment 4 Mickael Istria CLA 2017-05-19 06:08:04 EDT
Is this still true?(In reply to Steve Northover from comment #1)
> Windows can't be convinced to display wrapped text.

Is this still true?
Comment 5 Mickael Istria CLA 2017-05-19 06:23:27 EDT
*** Bug 324404 has been marked as a duplicate of this bug. ***
Comment 6 Mickael Istria CLA 2017-05-19 06:37:46 EDT
bug 42263 and