|Summary:||XSSFFont.getXSSFColor().getRgb() returns null for theme colors|
|Component:||XSSF||Assignee:||POI Developers List <dev>|
Description andrei 2011-02-15 10:31:37 UTC
Steps: 1. Create Excel doc. 2. Set font color with the theme color. 3. Call from POI XSSFFont font = (XSSFFont) workbook.getFontAt(cell.getCellStyle().getFontIndex()); byte rgb = font.getXSSFColor().getRgb(); Actual result: null Expected: rgb
Comment 1 Nick Burch 2011-02-15 11:50:36 UTC
I guess we'll need to pass the theme details into XSSFColor, and have it check those if needed Any chance you could create a simple document that shows this, along with a failing unit test? And ideally a patch too if you can :)
Comment 4 Nick Burch 2011-02-18 10:47:09 UTC
Thanks for this. I've added a disabled unit test in r1072027. It looks like we need to give XSSFColor a way to load themes from the theme table. Then, we need it to spot when something isn't set on the colour itself, and in that instance go check the parent theme. If you could work up a patch for that it'd be wonderful!
Comment 5 Nick Burch 2011-02-25 16:19:46 UTC
In XSSFCellStyle there is extractColorFromTheme, which does the appropriate work for theme based cell style colours I think we need the same thing for XSSFFont, but it'll need some work because XSSFFont doesn't currently have access to the themes table. If you can work up a patch that solves this that'd be great!