You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/10/10 08:02:20 UTC

svn commit: r1894093 - in /poi/trunk: poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java

Author: fanningpj
Date: Sun Oct 10 08:02:20 2021
New Revision: 1894093

URL: http://svn.apache.org/viewvc?rev=1894093&view=rev
Log:
[bug-65306] try to fix broken test

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
    poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1894093&r1=1894092&r2=1894093&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Sun Oct 10 08:02:20 2021
@@ -3055,7 +3055,10 @@ public class XSSFSheet extends POIXMLDoc
             // check if we should remove this row as it will be overwritten by the data later
             if (shouldRemoveRow(startRow, endRow, n, rownum)) {
                 for (Cell c : row) {
-                    c.setBlank();
+                    if (!c.isPartOfArrayFormulaGroup()) {
+                        //the support for deleting cells that are part of array formulas is not implemented yet
+                        c.setBlank();
+                    }
                 }
                 // remove row from worksheet.getSheetData row array
                 // Performance optimization: explicit boxing is slightly faster than auto-unboxing, though may use more memory

Modified: poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java?rev=1894093&r1=1894092&r2=1894093&view=diff
==============================================================================
--- poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java (original)
+++ poi/trunk/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestSheetUpdateArrayFormulas.java Sun Oct 10 08:02:20 2021
@@ -495,7 +495,7 @@ public abstract class BaseTestSheetUpdat
             //we cannot set individual formulas for cells included in an array formula
             sheet.setArrayFormula("A1:A3*B1:B3", CellRangeAddress.valueOf("C1:C3"));
             IllegalStateException e = assertThrows(IllegalStateException.class, () -> sheet.shiftRows(0, 0, 1));
-            String msg = "Cell Sheet0!C2 is part of a multi-cell array formula. You cannot change part of an array.";
+            String msg = "Row[rownum=0] contains cell(s) included in a multi-cell array formula. You cannot change part of an array.";
             assertEquals(msg, e.getMessage());
         /*
          TODO: enable shifting the whole array



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org