Bug 390412 - StyledText with a margin is laying out incorrectly.
Summary: StyledText with a margin is laying out incorrectly.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7.2   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: helpwanted, ui
Depends on:
Blocks:
 
Reported: 2012-09-26 03:48 EDT by Tomas R. CLA
Modified: 2020-05-10 00:12 EDT (History)
4 users (show)

See Also:


Attachments
StyledTextMarginsBugTest.java (7.78 KB, text/plain)
2012-09-26 03:48 EDT, Tomas R. CLA
no flags Details
ScreenShot of the described test case (26.62 KB, image/png)
2012-09-26 03:51 EDT, Tomas R. CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas R. CLA 2012-09-26 03:48:18 EDT
Created attachment 221498 [details]
StyledTextMarginsBugTest.java

StyledText with a margin is laying out incorrectly because of the bug in the StyledText.computeSize(int,int,boolean) method.

This bug results in incorrect layout of the StyledText with a margin set.

In my tests (and for my pourposes) I set a width constraint for the StyledText and expect that the text will be wrapped into additional lines (which it does btw), but the computeSize reports incorrect height (without the wrapped additional lines) which is inconsistent with the fact that the line is actually and correctly wrapped.

Only the computeSize(int,int,boolean) method has to be patched in my knowledge.


I attach a jUnit test class with:
- test case that fails if this bug is in place
- main method that runs the modelled setting

The test should be broadened to address all ill-effects of this bug - i currently test only right margin present.


If you can tell me, how to compile the swt library myself, than I can create a patch as well.
Comment 1 Tomas R. CLA 2012-09-26 03:51:42 EDT
Created attachment 221500 [details]
ScreenShot of the described test case
Comment 2 Tomas R. CLA 2012-09-26 16:17:02 EDT
This bug seems to be the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=387333
Comment 3 Lakshmi P Shanmugam CLA 2012-09-27 03:27:57 EDT
(In reply to comment #0)

> If you can tell me, how to compile the swt library myself, than I can create
> a patch as well.
Thanks for the report and offer to create a patch! This page has the steps required to setup and run the SWT source code --> http://eclipse.org/swt/git.php.
Comment 4 Eclipse Genie CLA 2020-05-10 00:12:19 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.