Bug 56011 - [PATCH] XSSFSheetXMLHandler should fallback to default style if cell style attribute not present
Summary: [PATCH] XSSFSheetXMLHandler should fallback to default style if cell style at...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-dev
Hardware: Macintosh All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-01-15 04:56 UTC by Shaun Kalley
Modified: 2014-02-01 20:56 UTC (History)
0 users



Attachments
the diff for this patch (1.89 KB, text/plain)
2014-01-15 04:56 UTC, Shaun Kalley
Details
diff for test case (1.93 KB, text/plain)
2014-01-15 19:24 UTC, Shaun Kalley
Details
test file to go in test-data/spreadsheet (26.28 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-01-15 19:25 UTC, Shaun Kalley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shaun Kalley 2014-01-15 04:56:51 UTC
Created attachment 31207 [details]
the diff for this patch

Currently, a style is only applied to a cell if the cell style attribute ("s") is present.  Following XSSFCell.getCellStyle(), if the attribute is not present, and there are are more than 0 styles in the styles table, we should use the default (0) style.

This patch may also be the resolution for https://issues.apache.org/bugzilla/show_bug.cgi?id=55648.
Comment 1 Nick Burch 2014-01-15 10:54:26 UTC
Any chance you could work up a short unit test to go with the patch, which shows the problem + ensures it is solved?
Comment 2 Shaun Kalley 2014-01-15 19:24:53 UTC
Created attachment 31211 [details]
diff for test case
Comment 3 Shaun Kalley 2014-01-15 19:25:59 UTC
Created attachment 31212 [details]
test file to go in test-data/spreadsheet
Comment 4 Shaun Kalley 2014-01-15 19:26:57 UTC
Please find a diff for the requested test case and an XLSX file used by the test attached.
Comment 5 Dominik Stadler 2014-02-01 20:56:03 UTC
Thanks for the patch and testcase, this is now included via r1563470, it will not be contained in 3.10, though, as we already cut that version before.