summaryrefslogtreecommitdiffstats
path: root/poi-excelant
diff options
context:
space:
mode:
Diffstat (limited to 'poi-excelant')
-rw-r--r--poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
index 55d8177949..2541b5174a 100644
--- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
+++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java
@@ -164,21 +164,22 @@ public class ExcelAntWorkbookUtil extends Typedef {
*/
protected FormulaEvaluator getEvaluator(String fileName) {
FormulaEvaluator evaluator;
- if (fileName.endsWith(".xlsx")) {
- if(xlsMacroList.size() > 0) {
+ if (!fileName.endsWith(".xlsx")) {
+ if(xlsMacroList.isEmpty()) {
+ evaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
+ } else {
evaluator = XSSFFormulaEvaluator.create((XSSFWorkbook) workbook,
null,
getFunctions());
}
- evaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
} else {
- if(xlsMacroList.size() > 0) {
+ if(xlsMacroList.isEmpty()) {
+ evaluator = new HSSFFormulaEvaluator((HSSFWorkbook) workbook);
+ } else {
evaluator = HSSFFormulaEvaluator.create((HSSFWorkbook)workbook,
null,
getFunctions());
}
-
- evaluator = new HSSFFormulaEvaluator((HSSFWorkbook) workbook);
}
return evaluator;