Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 55555 fix #33

Closed
wants to merge 1 commit into from

Conversation

@Qualtagh
Copy link

commented Jul 8, 2016

This is a fix for bug 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:

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:

style.setFillPattern(getShort(properties, FILL_PATTERN));
style.setFillForegroundColor(getShort(properties, FILL_FOREGROUND_COLOR));
style.setFillBackgroundColor(getShort(properties, FILL_BACKGROUND_COLOR));

Also, bugs 50849 and 59442 may have the same cause (I didn't check).

@asfgit asfgit closed this in 3092c11 Jul 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.