* Removes a merged region of cells (hence letting them free)
*
* @param index of the region to unmerge
*/
public void removeMergedRegion(int index) {
CTMergeCells ctMergeCells = worksheet.getMergeCells();
CTMergeCell[] mergeCellsArray = new CTMergeCell[ctMergeCells.sizeOfMergeCellArray() - 1];
for (int i = 0 ; i < ctMergeCells.sizeOfMergeCellArray() ; i++) {
if (i < index) {
mergeCellsArray[i] = ctMergeCells.getMergeCellArray(i);
}
else if (i > index) {
mergeCellsArray[i - 1] = ctMergeCells.getMergeCellArray(i);
}
}
ctMergeCells.setMergeCellArray(mergeCellsArray);
}