Bug 54373 - unable to add background color to a cell
Summary: unable to add background color to a cell
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-04 16:18 UTC by crazysuru
Modified: 2014-07-25 16:10 UTC (History)
1 user (show)



Attachments
problem what I faced (36.77 KB, image/png)
2013-01-04 16:18 UTC, crazysuru
Details
sample code (2.28 KB, text/plain)
2013-06-01 15:38 UTC, crazysuru
Details
test case file (1.91 KB, text/plain)
2013-06-01 15:39 UTC, crazysuru
Details
Afflicted fill entries from xl/styles.xml (330 bytes, text/plain)
2014-07-16 20:07 UTC, Eric Riese
Details
less a patch and more of a hint where the problem starts (1.01 KB, patch)
2014-07-25 16:10 UTC, Eric Riese
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.