poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46938] Existing color palette is broken(or not used) when using cell styles from opened workbook and creating new
Date Sun, 01 Nov 2009 10:51:11 GMT

Karl Eilebrecht <Karl.Eilebrecht@freenet.de> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
            Version|3.2-FINAL                   |3.5-FINAL
         Resolution|WONTFIX                     |

--- Comment #9 from Karl Eilebrecht <Karl.Eilebrecht@freenet.de> 2009-11-01 02:51:05
UTC ---
I ran into the same problem and must agree with the previous speakers, this
"bug" is an unsupported behaviour of Excel 2007, not an error of POI.

However, the situation is extremely disappointing for me, since I'll have to
support Excel 2007 for editing templates - and colors are very important for
some customers.

After a weekend of tracing the serialization of records and trial+error I tried
the following hack:

using POI 3.5-FINAL
Workbook.class, line 812
public ExtendedFormatRecord createCellXF() {
    int insertPos = records.getXfpos() + 1;
    if (insertPos < records.size()) {
        while (records.get(insertPos) instanceof UnknownRecord) {
            if (insertPos == records.size()) {
    records.add(insertPos, xf);
    records.setXfpos( insertPos );
    return xf;

Obviously this is rather a hack than a solution. It seems(!) to help.
And if so, this workaround could be useful for many people using POI.

I'd be pleased if some of the gurus could check if this "happy reordering" is
in conflict with any known rule of the excel format and thus may be
Especially testing with different excel versions (I only have 2007) would be



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-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message