GitHub user Qualtagh opened a pull request:
https://github.com/apache/poi/pull/33
Bug 55555 fix
This is a fix for [bug
55555](https://bz.apache.org/bugzilla/show_bug.cgi?id=55555) (background color
is reset to black after calls to CellUtil).
Javadoc for `HSSFCellStyle.setFillBackgroundColor` says "Note: Ensure
Foreground color is set prior to background". So, the order of operations in
`CellUtil.setFormatProperties` should be different. It's ordered
lexicographically now:
```java
style.setFillBackgroundColor(getShort(properties, FILL_BACKGROUND_COLOR));
style.setFillForegroundColor(getShort(properties, FILL_FOREGROUND_COLOR));
style.setFillPattern(getShort(properties, FILL_PATTERN));
```
According to HSSFCellStyle's javadoc, it should be so:
```java
style.setFillPattern(getShort(properties, FILL_PATTERN));
style.setFillForegroundColor(getShort(properties, FILL_FOREGROUND_COLOR));
style.setFillBackgroundColor(getShort(properties, FILL_BACKGROUND_COLOR));
```
Also, bugs [50849](https://bz.apache.org/bugzilla/show_bug.cgi?id=50849)
and [59442](https://bz.apache.org/bugzilla/show_bug.cgi?id=59442) _may_ have
the same cause (I didn't check).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Qualtagh/poi trunk
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/poi/pull/33.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #33
----
commit b6ccc6e68fea84b47376ecab9281d55c73c58456
Author: Qualtagh <[email protected]>
Date: 2016-07-08T15:20:23Z
The order of operations should be different as stated in
HSSFCellStyle.setFillBackgroundColor.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]