Bug 58084 - Corrupted styles.xml for file created with XSSFWorkbook
Summary: Corrupted styles.xml for file created with XSSFWorkbook
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
: 55800 (view as bug list)
Depends on: 55800
  Show dependency tree
Reported: 2015-06-29 18:17 UTC by findbastien
Modified: 2015-12-04 14:40 UTC (History)
1 user (show)

Test case see Main.java (10.93 KB, application/x-zip-compressed)
2015-06-29 18:17 UTC, findbastien
Narrowed down to bare minimum required code (1.48 KB, patch)
2015-09-14 16:36 UTC, Dominik Stadler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description findbastien 2015-06-29 18:17:30 UTC
Created attachment 32862 [details]
Test case see Main.java

In attachment a test case for this bug (see Main.java)

Basically :

1) I create a "reference" Workbook from a file "template.xlsx" that contains only 1 custom style;
2) I create a "target" Workbook (empty)
3) I copy the custom style from the "reference" workbook to the "target" workbook
4) I create one cell with the custom style
5) I output the target Workbook to a file
6) I close everyting and open the output file with Excel and I get an error about "styles.xml" corrupted

For some custom the style in "template.xlsx" I can get a output file without error, but with the one in the attached zip, it fails everytimes.
Comment 1 Dominik Stadler 2015-09-14 16:36:23 UTC
Created attachment 33108 [details]
Narrowed down to bare minimum required code

I worked a bit on reproducing this, the attached unit-test suffices to get an invalid document, it seems the StylesTable that POI writes out is not fully correct here.
Comment 2 Dominik Stadler 2015-12-04 13:55:00 UTC
*** Bug 55800 has been marked as a duplicate of this bug. ***
Comment 3 Dominik Stadler 2015-12-04 14:40:34 UTC
This should be fixed with r1717973, the border style was not copied over correctly when cloning styles across workbooks. Please try the next nightly build or version 3.14beta1 or newer as soon as it is released.