You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/09/29 01:59:41 UTC

[Bug 53691] Workbook corruption on cloneSheet when conditional formatting is used

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

Corey Teffetalor <co...@teffetalor.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |corey@teffetalor.com

--- Comment #5 from Corey Teffetalor <co...@teffetalor.com> ---
I can confirm this problem with some additional info:

I believe Excel does not alert you to this problem prior to Excel 2010 unless
the following (Optional?) security update is installed:
http://support.microsoft.com/kb/2501584

You can click through the error, and the conditional formatting still appears
to work properly.

The issue is specifically with how copying conditional formatting is done, if
you clone the sheet with conditional formatting, and then remove all
conditional formatting on the cloned sheet using
HSSFSheetConditionalFormatting.removeConditionalFormatting(int) before writing
the result. The resulting spreadsheet does not cause any Excel alerts, and all
other data is copied.

Then, if you attempt to re-copy the conditional formatting using:

HSSFSheetConditionalFormatting cf = sheet.getSheetConditionalFormatting();
for (int j = 0; j < scf.getNumConditionalFormattings(); j++) {
    cf.addConditionalFormatting(scf.getConditionalFormattingAt(j));
}

The error when loading the spreadsheet returns.

Tested on POI 3.7 3.8 and the latest binary nightly of 3.9beta1

Possibly an issue with how the copy is done in addConditionalFormatting?

Don't have this boiled down to a small test case yet, but can update with one
if more test-cases are desired.

Thanks,
--Corey

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