Bug 56914

Summary: XSSFRowShifter.updateConditionalFormatting throws IOOBE when there are more than 1 CTConditionalFormatting
Product: POI Reporter: Yaniv Kunda <yaniv>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.11-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: 56914

Description Yaniv Kunda 2014-09-04 12:25:15 UTC
The iteration done over the sheet's CTConditionalFormatting objects possibly uses ctWorksheet.removeConditionalFormatting(j), but does not update the iteration index j.

For example, if there are 2 CTConditionalFormatting objects, and the first iteration removes it (at index 0), the second one fails to get it, since index 1 is already out of bounds.
Comment 1 Yaniv Kunda 2014-09-04 12:30:21 UTC
Created attachment 31964 [details]
56914

Fixes the iteration problem by using a backwards iteration, and using more efficient one-time fetch of the XMLBeans array.
Modified BaseTestConditionalFormatting.testShiftRows to use two conditional formatting objects.
Comment 2 Andreas Beeker 2014-09-05 19:08:24 UTC
Thank you for the patch.
Applied with r1622759