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

Bug 354120

Summary: AbstractTable: Cell icon not considered when wrapping text
Product: z_Archived Reporter: Beat Schwarzentrub <bsh>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: steiner.ralph, zimmermann
Version: unspecifiedFlags: andi.bur: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Example.java
none
TestTable_NOK.png
none
TestTable_OK.png
none
Proposed Patch
andi.bur: iplog+
Test Table with the patch applied none

Description Beat Schwarzentrub CLA 2011-08-08 06:02:12 EDT
Build Identifier: 3.7.0.2011-Jun 2011

PROBLEM DESCRIPTION:
When a column has getConfiguredTextWrap() = true, the text is broken up in multiple lines and the row's height is adjusted so that the full text is visible. However, the algorithm that adjusts the row's height does not seem to consider cell icons. It is possible that the text is wrapped, but the row's height is not adjusted.

In the attached example, the word "IMPORTANT" cannot be seen ("NOK"). When the column width is decreased about the width of the icon, the wrapping is correct ("OK").

EVALUATION:
-

PROPOSED SOLUTION:
-

Reproducible: Always
Comment 1 Beat Schwarzentrub CLA 2011-08-08 06:02:45 EDT
Created attachment 201063 [details]
Example.java
Comment 2 Beat Schwarzentrub CLA 2011-08-08 06:02:56 EDT
Created attachment 201064 [details]
TestTable_NOK.png
Comment 3 Beat Schwarzentrub CLA 2011-08-08 06:03:05 EDT
Created attachment 201065 [details]
TestTable_OK.png
Comment 4 Ralph Steiner CLA 2012-02-08 09:32:19 EST
Created attachment 210736 [details]
Proposed Patch

I've found the bug. I had the same problem in a diffrent context. With this patch, all worked fine. I've not tested the patch against the example provided by Beat Schwarzentrub.

As one can see in the patch, the bug and its fix is obvious. (iconR.width would be always '0'. The developer had the 'icon' variable in mind not the 'iconR')
Comment 5 Ralph Steiner CLA 2012-02-09 03:27:21 EST
Created attachment 210776 [details]
Test Table with the patch applied

I have tested now the patch against the test table code from Beat Schwarzentrub. I have created a new empty project and added an empty form with this test table. The attached picture shows the correct behavior with the patch. Test was done on the scout trunk.
Comment 6 Andi Bur CLA 2012-08-17 10:57:57 EDT
Reviewed and applied patch on Scout branches 3.8 and 3.9.
Beat, Ralph: Thanks for your contribution.
Comment 7 Matthias Zimmermann CLA 2012-11-13 02:36:24 EST
shipped with scout juno sr1