The return value of the following function is the same before and after calling XSSFSheet.addMergedRegion(CellRangeAddress): XSSFSheet.getCTWorksheet().getMergeCells().getCount() The return value of the following functions increments properly after calling addMergedRegion: XSSFSheet.getMergedRegions.size() XSSFSheet.getNumMergedRegions() XSSFSheet.getCTWorksheet().getMergeCells().getMergeCellList().size(). I will be uploading a test case and a patch soon.
Created attachment 36540 [details] Patch to have addMergedRegion update CTMergeCells.getCount() This also includes a fix to bug 63073
Created attachment 36541 [details] Test case to illustrate bug 63371 Before applying the patch, this code writes the following to System.out: testMergeRegions(After adding first region) ranges.size=1 numMergedRegions=1 ctMergeCellCount=0 ctMergeCellListSize=1 After applying the patch, the result is testMergeRegions(After adding first region) ranges.size=1 numMergedRegions=1 ctMergeCellCount=1 ctMergeCellListSize=1
Fixed on trunk via r1858022, thanks for the patch!