poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60845] copied cell style and CF
Date Wed, 15 Mar 2017 10:40:21 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=60845

--- Comment #7 from dollinger.florian@gmx.de ---
Thanks for all your replies!
I finally found out where the problem is:

1) Excel shows conditional formatting if, and only if, the cell has fillId=0
(the default NONE one) OR if the fillStylePattern != NONE.
Thats a bug in Excel, not in POI.

2) The problem is, that Excel is de facto "Standard".
POI calls like this to set the new Style: setCellStyleProperties >>
setFormatProperties >> setFillPattern

Here is what setFillPattern looks like:

Java Code:
public void setFillPattern(FillPatternType pattern) {
        CTFill ct = getCTFill();
        CTPatternFill ctptrn = ct.isSetPatternFill() ? ct.getPatternFill() :
ct.addNewPatternFill();

        if (pattern == FillPatternType.NO_FILL && ctptrn.isSetPatternType()) {
                ctptrn.unsetPatternType();
        } else {
               
ctptrn.setPatternType(STPatternType.Enum.forInt(pattern.getCode() + 1));
        }

        addFill(ct);
}


It (POI) does simply not check if the FillStyle does already exist, it always
adds a new one. And in general, this is then not fullfilling condtions in 1)

-- 
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


Mime
View raw message