From 1539f4629d066eb9893bb73e41445a597c788327 Mon Sep 17 00:00:00 2001 From: abel Date: Mon, 6 Jun 2022 21:20:34 +0800 Subject: [PATCH] =?UTF-8?q?BI=E5=AF=BC=E5=87=BA=E5=8F=98=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third/v2/org/apache/poi/xssf/usermodel/XSSFSheet.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/usermodel/XSSFSheet.java b/fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/usermodel/XSSFSheet.java index 143fe60cf..6350f257f 100644 --- a/fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/fine-poi/src/main/java/com/fr/third/v2/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -174,6 +174,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { private SortedMap tables; private List arrayFormulas; private XSSFDataValidationHelper dataValidationHelper; + private int size; /** * Creates new XSSFSheet - called by XSSFWorkbook to create a sheet from scratch. @@ -413,12 +414,8 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { CTMergeCells ctMergeCells = worksheet.isSetMergeCells() ? worksheet.getMergeCells() : worksheet.addNewMergeCells(); CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell(); 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; } /**