https://bz.apache.org/bugzilla/show_bug.cgi?id=60902

--- Comment #11 from [email protected] ---
(In reply to Mark Murphy from comment #8)
> setCellStyleProperties() doesn't copy anything. You have to put the
> properties you want in the map. that can include fonts if you choose. It
> does not handle colors other than indexed colors though, but that is due to
> the fact that HSSF only supports indexed colors, and
> CellUtil.setCellStyleProperties is part of the converged interface. POI
> would be better served if you found a way to handle the XSSF color
> differences in the converged interface rather than create a whole new set of
> methods. Probably need a way to convert themed colors to indexed colors if
> the user tries to use themed colors with an HSSF sheet. Other than themed
> colors, CellUtil.setStyleProperties() supports all the CellStyle attributes
> for XSSF.

Yes, sorry for the inaccuracy.

1) .setCellStyleProperties() is not the best choice for my use case. I want to
copy cells including their properties from one workbook to another (since I am
developing a table merging tool for my company).  I tried to use
.cloneCellStyle() at first, but that somehow crashed the conditional formatting
in the destination workbook/worksheet (bug 60845).

2) I also tried .setCellStyleProperties(), but I gave it up (for now) since
colors are not yet fully supported, and fonts have to be copied manually, and
also because of some other problems (bug 60895)

3) I then fixed the issue in 1), just to realize that, using .cloneCellStyle(),
I will end up with many many redundant cellStyles. That's why i thought that a
"global" .cloneCellStyle() is not a bad idea (bug 60902, this one)


But, yes - It is a good idea to extend .setCellStyleProperties() to XSSF, it
would be also nice to have something like .getCellStyleProperties() - but thats
a whole bunch of work and that's something I cannot do in the next weeks or
months.

But what speaks against the solution above?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to