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