Bug 50846

Summary: XSSFCellStyle.get*BorderXSSFColor().getRgb() returns null for theme colors
Product: POI Reporter: andrei <andrei.astrouski>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.7-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: BorderColorTest.java
BorderColorTest.xlsx

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.