diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-12-30 21:18:26 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-12-30 21:18:26 +0000 |
commit | 9345c84194c677ce9bc1caab386e4d7936771e35 (patch) | |
tree | 7d31da98184c5a88fb8f7292e29a40b9a19a0cc1 | |
parent | 4823d0cbd4add5a5dbb99ce52acb61921362f5b5 (diff) | |
download | poi-9345c84194c677ce9bc1caab386e4d7936771e35.tar.gz poi-9345c84194c677ce9bc1caab386e4d7936771e35.zip |
excelant evaluator if seems useless
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896546 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poi-excelant/src/main/java/org/apache/poi/ss/excelant/util/ExcelAntWorkbookUtil.java | 13 | ||||
-rw-r--r-- | poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java | 2 |
2 files changed, 8 insertions, 7 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; diff --git a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java index a10aca3a28..339203890e 100644 --- a/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java +++ b/poi/src/main/java/org/apache/poi/ss/format/CellNumberPartHandler.java @@ -81,7 +81,7 @@ public class CellNumberPartHandler implements PartHandler { case '/': //!! This assumes there is a numerator and a denominator, but these are actually optional - if (slash == null && specials.size() > 0) { + if (slash == null && !specials.isEmpty()) { numerator = previousNumber(); // If the first number in the whole format is the numerator, the // entire number should be printed as an improper fraction |