|
|
@ -174,6 +174,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { |
|
|
|
private SortedMap<String,XSSFTable> tables; |
|
|
|
private SortedMap<String,XSSFTable> tables; |
|
|
|
private List<CellRangeAddress> arrayFormulas; |
|
|
|
private List<CellRangeAddress> arrayFormulas; |
|
|
|
private XSSFDataValidationHelper dataValidationHelper; |
|
|
|
private XSSFDataValidationHelper dataValidationHelper; |
|
|
|
|
|
|
|
private int size; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Creates new XSSFSheet - called by XSSFWorkbook to create a sheet from scratch. |
|
|
|
* Creates new XSSFSheet - called by XSSFWorkbook to create a sheet from scratch. |
|
|
@ -408,21 +409,13 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { |
|
|
|
// throw IllegalStateException if the argument CellRangeAddress intersects with
|
|
|
|
// throw IllegalStateException if the argument CellRangeAddress intersects with
|
|
|
|
// a multi-cell array formula defined in this sheet
|
|
|
|
// a multi-cell array formula defined in this sheet
|
|
|
|
validateArrayFormulas(region); |
|
|
|
validateArrayFormulas(region); |
|
|
|
|
|
|
|
|
|
|
|
// Throw IllegalStateException if the argument CellRangeAddress intersects with
|
|
|
|
|
|
|
|
// a merged region already in this sheet
|
|
|
|
|
|
|
|
validateMergedRegions(region); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CTMergeCells ctMergeCells = worksheet.isSetMergeCells() ? worksheet.getMergeCells() : worksheet.addNewMergeCells(); |
|
|
|
CTMergeCells ctMergeCells = worksheet.isSetMergeCells() ? worksheet.getMergeCells() : worksheet.addNewMergeCells(); |
|
|
|
CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell(); |
|
|
|
CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell(); |
|
|
|
ctMergeCell.setRef(region.formatAsString()); |
|
|
|
ctMergeCell.setRef(region.formatAsString()); |
|
|
|
final int numMergeRegions=ctMergeCells.sizeOfMergeCellArray(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// also adjust the number of merged regions overall
|
|
|
|
|
|
|
|
ctMergeCells.setCount(numMergeRegions); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return numMergeRegions-1; |
|
|
|
return ++this.size; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|