Summary: | Corrupted Excel file produced due to wrong dimension calculation during XSSFWorkbook.write(str) call | ||
---|---|---|---|
Product: | POI | Reporter: | Marek <marek.zaplata> |
Component: | XSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | dolphin.in.the.sky.51, jpstotz, richard.evans |
Priority: | P2 | ||
Version: | 3.17-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Bug Depends on: | 53611 | ||
Bug Blocks: | |||
Attachments: | Corrupted file generated by JUnit test attached |
Description
Marek
2017-11-22 13:33:09 UTC
Excuse my poor English. I am applying the patch of the following contents. in org.apache.xssf.usermodel.XSSFSheet protected write(OutputStream out) throws IOException { ... // then calculate min/max cell-numbers for the worksheet-dimension if(row.getFirstCellNum() != -1) { // maxCell = Math.min(maxCell, row.getLastCellNum()); maxCell = Math.min(maxCell, row.getLastCellNum()-1); } Row.getLastCellNum() is return the index of the last cell contained in this row PLUS ONE. I would be pleased if it will be helpful. I made a mistake in patch code. not "row.getFirstCellNum()" Correctly,"row.getLastCellNum()" Sorry. Fixed with r1819404, now the dimension should be calculated correctly. *** Bug 62490 has been marked as a duplicate of this bug. *** |