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

Bug 325906

Summary: TextLayout with width smaller than word on MacOS X with Carbon adds an extra break before the word
Product: [Eclipse Project] Platform Reporter: Hugo Corbucci <nightao>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED WONTFIX QA Contact: Lakshmi P Shanmugam <lshanmug>
Severity: normal    
Priority: P3 CC: skovatch
Version: 4.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Hugo Corbucci CLA 2010-09-21 16:49:48 EDT
Build Identifier: 20100617-1415

This a platform window system specific bug. It does not happen on Windows or Cocoa.
The problem is on line 402 of TextLayout class for carbon in the computeRuns():void method.
There is a call to "OS.ATSUGetSoftLineBreaks(layout, 0, OS.kATSUToTextEnd, count, breaks, null);" which returns a break on character index 1 if the first word wraps without spaces.

Reproducible: Always

Steps to Reproduce:
1. Create a StyledText with SWT.WRAP.
2. Type in a very long word that wraps without spaces.
3. As soon as you type the character that triggers the wrap, you will notice that the word is drawn one line below where it should be.
Comment 1 Scott Kovatch CLA 2010-09-21 19:42:19 EDT
This is Carbon, so it may not be addressed as we're trying to phase out 3.7. Over to Silenio.
Comment 2 Silenio Quarti CLA 2012-06-21 14:30:38 EDT
Closing report, platform is discontinued.

Works on cocoa.