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

Bug 366335

Summary: Text control with SWT.SINGLE style on Cocoa does not remove newline breaks
Product: [Eclipse Project] Platform Reporter: <h1055071>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: lshanmug
Version: 3.7.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description CLA 2011-12-11 10:35:29 EST
On Mac Cocoa:

1. Create a Text Control with the SWT.SINGLE style.
2. Copy the following text lines to the system clipboard:

Here is some text
with some
new line
breaks

3. Paste (Command-V) this text into the Text control.

Result - the Text control displays the first line of text, but pressing the down arrow key when the control has the focus reveals the other lines of text. The newline characters are left in.

This is not the case with the Text control on Carbon, where newline characters are replaced with " " characters and all text is visible on a single line.
Comment 1 CLA 2011-12-11 10:47:40 EST
Further information:

On Windows, pasted multi-line text is curtailed up to the first newline character.

On Cocoa, with the SWT.SEARCH style in addition to SWT.SINGLE the newline characters are stripped from the pasted multi-line text.
Comment 2 Lakshmi P Shanmugam CLA 2011-12-12 03:50:54 EST
Duplicate of Bug 273470

*** This bug has been marked as a duplicate of bug 273470 ***