// 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
//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