[bug-66213] hack clone table code to avoid failing with edge cases

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-08-14 09:50:00 +00:00
parent 711ab033f3
commit e8f53b3084
1 changed files with 3 additions and 2 deletions

View File

@ -4948,8 +4948,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet, OoxmlSheetEx
int c = clonedTable.getStartCellReference().getCol() + i;
sheet.getWorkbook().setCellFormulaValidation(false);
for (int r = rFirst; r <= rLast; r++) {
XSSFRow row = sheet.getRow(r); if (row == null) row = sheet.createRow(r);
XSSFCell cell = row.getCell(c); if (cell == null) cell = row.createCell(c);
XSSFRow row = sheet.getRow(r);
if (row == null) row = sheet.createRow(r);
XSSFCell cell = row.getCell(c, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
cell.setCellFormula(clonedFormula);
}
}