Bug 55280: Don't repeatedely fetch the size of the CTMergeCells object as this is a costly operation with XMLBeans
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1621631 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
809ec00a7d
commit
3eec314719
@ -1579,8 +1579,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
|
||||
public void removeMergedRegion(int index) {
|
||||
CTMergeCells ctMergeCells = worksheet.getMergeCells();
|
||||
|
||||
CTMergeCell[] mergeCellsArray = new CTMergeCell[ctMergeCells.sizeOfMergeCellArray() - 1];
|
||||
for (int i = 0 ; i < ctMergeCells.sizeOfMergeCellArray() ; i++) {
|
||||
int size = ctMergeCells.sizeOfMergeCellArray();
|
||||
CTMergeCell[] mergeCellsArray = new CTMergeCell[size - 1];
|
||||
for (int i = 0 ; i < size ; i++) {
|
||||
if (i < index) {
|
||||
mergeCellsArray[i] = ctMergeCells.getMergeCellArray(i);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user