https://issues.apache.org/bugzilla/show_bug.cgi?id=46938

--- Comment #13 from Karl Eilebrecht <karl.eilebre...@freenet.de> 2009-11-16 
05:36:32 UTC ---
Remark:

Today I tested (successfully) with a more complex excel sheet and found out
that the color-palette corruption problem may return if you modify cell styles
that came with the original file. Strange ...

To avoid this do not modify original cell styles but copy them (only once(!),
you do not have to duplicate them for single usage).

Problematic:
HSSFCellStyle myStyle = workbook.getCellStyleAt(idx);
myStyle.setFillPattern(HSSFCellStyle.BIG_SPOTS);
myStyle.setFillForegroundColor(HSSFColor.WHITE.index);
myStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
//...
//use myStyle n-times

Better:
HSSFCellStyle myStyle = workbook.createCellStyle();
myStyle.cloneStyleFrom(workbook.getCellStyleAt(idx));
//...
//use myStyle n-times

Regards.
Karl

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to