Bug 58350

Summary: [PATCH] Make (S)XSSFSheet behavior the same as HSSFSheet when calling getMergedRegions
Product: POI Reporter: Javen O'Neal <onealj>
Component: XSSFAssignee: POI Developers List <dev>
Severity: enhancement Keywords: PatchAvailable
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Bug Depends on: 57893    
Bug Blocks: 58348, 58443, 58485    
Attachments: XSSFSheet.getMergedRegions return empty list

Description Javen O'Neal 2015-09-10 02:32:42 UTC
Created attachment 33086 [details]
XSSFSheet.getMergedRegions return empty list

From bug 57893 comment 7:

r1690661 makes the behavior of XSSFSheet and SXSSFSheet inconsistent with HSSFSheet if the worksheet does not have a merged regions container, raising an IllegalStateException if the sheet is missing a merged regions container.

The attached patch makes XSSFSheet/SXSSFSheet behave the same as HSSFSheet by returning an empty list when getMergedRegions is called. This is consistent with XSSFSheet.getNumMergedRegions -> returns 0 if worksheet.getMergeCells() is null.
Comment 1 David North 2015-09-23 12:53:35 UTC
Fixed on trunk in r1704839, thanks for the patch.
Comment 2 Javen O'Neal 2015-10-06 21:16:57 UTC
This change was committed after 3.13-FINAL. This change will be included in 3.14-dev.