You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2022/02/17 12:44:01 UTC

[Bug 65896] New: XSLFTable::mergeCells ineffective in single column tables

https://bz.apache.org/bugzilla/show_bug.cgi?id=65896

            Bug ID: 65896
           Summary: XSLFTable::mergeCells ineffective in single column
                    tables
           Product: POI
           Version: 5.2.0-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: dev@poi.apache.org
          Reporter: apache@simondavey.me.uk
  Target Milestone: ---

Created attachment 38200
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38200&action=edit
Testcase and Workaround demo - source

We have found an issue where the POI XSLFTable::mergeCells method seems
ineffective at setting rowspans if the table only has a single column.

We have seen that POI is setting the rowspan=... attribute in the output Slide
XML, however MS PowerPoint is ignoring it. Trying the same cell merging
manually in PowerPoint GUI reveals that instead of setting rowspan, PowerPoint
will remove the spanned-over rows and set the height of the first row to the
total of the spanned over rows.

This makes me wonder if the POI XSLFTable::mergeCells method needs an update to
mimick this technique along the lines of:

    if (tbl.getNumberOfColumns() == 1) {
      double h = tbl.getRowHeight(fromRow);
      // accumulate spanned-over row heights as we remove them
      for (int r = toRow; r > fromRow; --r) {
        h += tbl.getRowHeight(r);
        tbl.removeRow(r);
      }
      tbl.setRowHeight(fromRow, h);
    }
    else {
      tbl.mergeCells(fromRow, toRow, fromCol, toCol);
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65896] XSLFTable::mergeCells ineffective in single column tables

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65896

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65896] XSLFTable::mergeCells ineffective in single column tables

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65896

--- Comment #2 from Simon Davey <ap...@simondavey.me.uk> ---
Created attachment 38202
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38202&action=edit
Testcase and Workaround demo - output (screenshot)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65896] XSLFTable::mergeCells ineffective in single column tables

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65896

--- Comment #1 from Simon Davey <ap...@simondavey.me.uk> ---
Created attachment 38201
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38201&action=edit
Testcase and Workaround demo - output

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org