You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Qualtagh <gi...@git.apache.org> on 2016/07/08 15:39:50 UTC

[GitHub] poi pull request #33: Bug 55555 fix

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 <xg...@gmail.com>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[GitHub] poi pull request #33: Bug 55555 fix

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/poi/pull/33


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org