fix class cast issur recently introduced in BaseXSSFFormulaEvaluator

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844311 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-10-19 07:43:04 +00:00
parent 6b433ae8b3
commit 59ee53ca71
1 changed files with 9 additions and 4 deletions

View File

@ -73,9 +73,14 @@ public abstract class BaseXSSFFormulaEvaluator extends BaseFormulaEvaluator {
}
protected void setCellType(Cell cell, CellType cellType) {
if (cell instanceof XSSFCell) {
EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
BaseXSSFEvaluationWorkbook xewb = BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass()) ? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
((XSSFCell) cell).setCellType(cellType, xewb);
} else {
// could be an SXSSFCell
cell.setCellType(cellType);
}
}
}