Bug 176380 - [Forms] TableWrapLayout incorrectly calculates height for rowspan > 1
Summary: [Forms] TableWrapLayout incorrectly calculates height for rowspan > 1
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Curtis d'Entremont CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-03-05 10:45 EST by Marco mvmsoft CLA
Modified: 2007-03-07 18:01 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco mvmsoft CLA 2007-03-05 10:45:10 EST
Build ID: Eclipse 3.3

Steps To Reproduce:
just check the code, you'll see its wrong, or:
1. create Composite with table wrap layout
2. create label with colspan = 3
3. create label with rowspan = 2, colspan = 1
4. create text field with rowspan = 2, colspan = 2
Check the layout, height of component with rowspan is wrong.

More information:
method update() in TableWrapLayout.Rowspan is wrong, must be:

public void update( int currentRow, int rowHeight ) {
 TableWrapData td = ( TableWrapData )child.getLayoutData();
---------------------------
if( row <= currentRow && currentRow <= row + td.rowspan - 1 ---------------------------
) {
      totalHeight += rowHeight;
      if( currentRow > row )
        totalHeight += verticalSpacing;
     }
  }
Comment 1 Curtis d'Entremont CLA 2007-03-07 18:00:04 EST
You must have spent hours debugging this.
Comment 2 Curtis d'Entremont CLA 2007-03-07 18:01:43 EST
Fixed.

Made a slight adjustment for readability:
if (currentRow >= row && currentRow < row + td.rowspan) {

and added comments. Thanks!