Bug 54373

Summary: unable to add background color to a cell
Product: POI Reporter: crazysuru <surendra.reddy544>
Component: XSSFAssignee: POI Developers List <dev>
Status: NEEDINFO ---    
Severity: major CC: eric.riese
Priority: P2    
Version: 3.10-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: problem what I faced
sample code
test case file
Afflicted fill entries from xl/styles.xml
less a patch and more of a hint where the problem starts

Description crazysuru 2013-01-04 16:18:59 UTC
Created attachment 29815 [details]
problem what I faced
Comment 1 Dominik Stadler 2013-06-01 11:57:19 UTC
Can you provide a unit-test which shows the problem? It might be caused by processing before the few lines in the screenshot and thus might be hard to reproduce without this.
Comment 2 crazysuru 2013-06-01 15:38:10 UTC
Created attachment 30359 [details]
sample code
Comment 3 crazysuru 2013-06-01 15:39:27 UTC
Created attachment 30360 [details]
test case file
Comment 4 Eric Riese 2014-07-16 20:07:16 UTC
Created attachment 31823 [details]
Afflicted fill entries from xl/styles.xml

The first fill was preexisting in the file which was originally generated by Excel. The other two were created with POI.

As per the Open XML SDK 2.0 Productivity Tool for Microsoft Office
"The attribute 'rgb' has invalid value 'FF0000'. The actual length according to datatype 'hexBinary' is not equal to the specified length. The expected length is 4."
Comment 5 Nick Burch 2014-07-24 16:07:57 UTC
(In reply to Eric Riese from comment #4)
> As per the Open XML SDK 2.0 Productivity Tool for Microsoft Office
> "The attribute 'rgb' has invalid value 'FF0000'. The actual length according
> to datatype 'hexBinary' is not equal to the specified length. The expected
> length is 4."

Some .xlsx colours require a 4 hex form (ARGB), others require a 3 hex form (RGB). At first glance, it would appear that the wrong kind is getting written

Any chance someone could step into the colour and style code with a debugger, and see what is getting written where and why, to try to narrow down where the bug is coming in?
Comment 6 Eric Riese 2014-07-25 16:10:43 UTC
Created attachment 31851 [details]
less a patch and more of a hint where the problem starts

I was having trouble building and debugging this, but this is the least of what's wrong. This is the first place where the alpha byte is lost.