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 2020/09/03 11:39:14 UTC

[Bug 64707] New: Editing existing XSSFTable without header corrupts xlsx

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

            Bug ID: 64707
           Summary: Editing existing XSSFTable without header corrupts
                    xlsx
           Product: POI
           Version: 4.1.x-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: pkirchdorfer@gmail.com
  Target Milestone: ---

Editing a XSSFTable without header leads to a corrupted x

Steps to reproduce: 
1) Create a XLSX with a XSSFTable and remove / hide the header.
2) Use Apache POI to open the XLSX file and add a few lines to the table
3) Adjust the AreaReference to cover all added data
4) Write XLSX and open in Excel

The method XSSFTable.updateHeaders() always updates the table headers
regardless of getHeaderRowCount().
Therefore it tries to write the first row of data into the header names.

Suggestion for a fix: XSSFTable::updateHeaders, line 821:
Extend the existing "if" with a check for getHeaderRowCount() > 0

 << if (row != null && row.getCTRow().validate()) {
 >> if (row != null && row.getCTRow().validate() && getHeaderRowCount() > 0) {

-- 
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 64707] Editing existing XSSFTable without header corrupts xlsx

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal

-- 
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 64707] Editing existing XSSFTable without header corrupts xlsx

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Can you provide the minimal java-code to reproduce this to be able to add a
test along a fix?

-- 
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