Bug 52079

Summary: Colors black font white when specifically set
Product: POI Reporter: Greg Jungman <gjungman>
Component: XSSFAssignee: POI Developers List <dev>
Severity: major CC: bodo, mcroci
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Bug Depends on: 51236, 53274    
Bug Blocks:    
Attachments: change XSSFColor constructors to adjust black and white

Description Greg Jungman 2011-10-24 21:43:33 UTC
When I upgraded to 3.8 beta from 3.7 I had to adjust the below.  I have code that assigns the font, I had to change the code to not execute the below command if the font color was black, otherwise the text would be white, on a white background.

               if (!foreground.equals(Color.BLACK))// poi version 3.8 beta required to fix some bugs, but can't handle black foreground
                    ((XSSFFont) font).setColor(new XSSFColor(foreground));
Comment 1 Bodo Wippermann 2012-08-06 14:32:30 UTC
i can confirm it in 3.8 release.

i think it is the incorrect missing use of the method "correctRGB" in the 2 constructors of XSSFColor.
calling this.setRgb(...) instad of ctColor.setRgb(...) would fix it.
Comment 2 Bodo Wippermann 2012-08-13 18:51:49 UTC
Created attachment 29219 [details]
change XSSFColor constructors to adjust black and white

additionally patched org.apache.poi.xssf.model.ThemesTable as it used the constructor.

this patch will change the behavior of XSSFColor !
Comment 3 Dominik Stadler 2015-08-25 19:15:40 UTC
Also bug 53274 sounds related.
Comment 4 Yoann Rodière 2016-07-12 07:26:28 UTC
It seems that this bug has been finally solved in r1694093, released in POI version 3.14. See #51222 for explanations, and in particular https://bz.apache.org/bugzilla/show_bug.cgi?id=51222#c6 for a thorough analysis.

*** This bug has been marked as a duplicate of bug 51222 ***