Bug 50846 - XSSFCellStyle.get*BorderXSSFColor().getRgb() returns null for theme colors
Summary: XSSFCellStyle.get*BorderXSSFColor().getRgb() returns null for theme colors
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.7-FINAL
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 09:03 UTC by andrei
Modified: 2011-03-18 11:19 UTC (History)
0 users



Attachments
BorderColorTest.java (1.50 KB, application/octet-stream)
2011-03-09 07:46 UTC, andrei
Details
BorderColorTest.xlsx (12.09 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2011-03-09 07:47 UTC, andrei
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andrei 2011-03-01 09:03:55 UTC
Steps:
1. Create Excel doc.
2. Set border color with the theme palette.
3. Call from POI
cell.getCellStyle().getTopBorderXSSFColor().getRgb()

Actual result: null
Expected: rgb
Comment 1 Nick Burch 2011-03-01 11:03:22 UTC
Does this apply to a recent nightly build / svn checkout?

(I think it probably does, but I wanted to double check given all the other xssf colour changes and fixes recently)
Comment 2 andrei 2011-03-02 10:03:34 UTC
It's reproduced
Comment 3 Nick Burch 2011-03-04 09:38:22 UTC
I think I've solved this in r1077968.

However, I didn't have a suitable file to hand to write a unit test for this with. Any chance you could upload a sample file with two styles, one which has the border set with theme colours, and one with the border set with non-theme (i.e. normal) colours? We can then use that for a unit test.
Comment 4 andrei 2011-03-09 07:46:56 UTC
Created attachment 26748 [details]
BorderColorTest.java
Comment 5 andrei 2011-03-09 07:47:27 UTC
Created attachment 26749 [details]
BorderColorTest.xlsx
Comment 6 andrei 2011-03-09 07:50:22 UTC
Unfortunately the bug is still reproduced
Comment 7 andrei 2011-03-09 07:56:53 UTC
StylesTable (including XSSFCellBorder) is initialized with null theme and only after that setTheme(ThemesTable) is called. So XSSFCellBorder has null theme.
Comment 8 Nick Burch 2011-03-18 11:19:27 UTC
Thanks for the file and the unit test. I've switched XSSFCellBorder to behaving more like XSSFFont in how it gets the theme table. That then allows your unit test to pass fine. Fixed in r1082946.