https://issues.apache.org/bugzilla/show_bug.cgi?id=55280
--- Comment #2 from proplant <[email protected]> --- We migrated from HSSF to XSSF and did not notice the problem with HSSF. I tried the following code to do a faster remove from outside POI. It is copied and changed from XSSFSheet.removeMergedRegion(int): ---------------------- public static void removeMergedRegions(XSSFSheet sheet, HashSet<Integer> indices) { if (indices.size() == 0) return; CTWorksheet worksheet = getCTWorksheet(sheet); // via reflection CTMergeCells ctMergeCells = worksheet.getMergeCells(); CTMergeCell[] mergeCellsArray = new CTMergeCell[ctMergeCells.sizeOfMergeCellArray() - indices.size()]; int d = 0; for (int i = 0 ; i < ctMergeCells.sizeOfMergeCellArray() ; i++) { if (! indices.contains(i)) { mergeCellsArray[d++] = ctMergeCells.getMergeCellArray(i); } } if(mergeCellsArray.length > 0){ ctMergeCells.setMergeCellArray(mergeCellsArray); } else{ worksheet.unsetMergeCells(); } } -------------------- It worked so far, but it doesn't fix the internal usages of removeMergedRegion. At this point we decided to use a workaround (different excel output). -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
