Author: centic
Date: Sun Aug 31 19:53:53 2014
New Revision: 1621631
URL: http://svn.apache.org/r1621631
Log:
Bug 55280: Don't repeatedely fetch the size of the CTMergeCells object as this
is a costly operation with XMLBeans
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1621631&r1=1621630&r2=1621631&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Sun
Aug 31 19:53:53 2014
@@ -1579,8 +1579,9 @@ public class XSSFSheet extends POIXMLDoc
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);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]