Update Apache POI to 4.0.1

This commit is contained in:
Antonin Delpeuch 2018-12-30 21:55:58 +01:00
parent 79ec6988d6
commit d0eff4c5a8
2 changed files with 8 additions and 7 deletions

View File

@ -349,7 +349,7 @@
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>3.8</version> <!-- in classpath: 3.13-20150929 --> <version>4.0.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>

View File

@ -50,6 +50,7 @@ import org.apache.poi.common.usermodel.Hyperlink;
import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -239,19 +240,19 @@ public class ExcelImporter extends TabularImportingParserBase {
} }
static protected Serializable extractCell(org.apache.poi.ss.usermodel.Cell cell) { static protected Serializable extractCell(org.apache.poi.ss.usermodel.Cell cell) {
int cellType = cell.getCellType(); CellType cellType = cell.getCellType();
if (cellType == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA) { if (cellType.equals(CellType.FORMULA)) {
cellType = cell.getCachedFormulaResultType(); cellType = cell.getCachedFormulaResultType();
} }
if (cellType == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_ERROR || if (cellType.equals(CellType.ERROR) ||
cellType == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK) { cellType.equals(CellType.BLANK)) {
return null; return null;
} }
Serializable value = null; Serializable value = null;
if (cellType == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BOOLEAN) { if (cellType.equals(CellType.BOOLEAN)) {
value = cell.getBooleanCellValue(); value = cell.getBooleanCellValue();
} else if (cellType == org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC) { } else if (cellType.equals(CellType.NUMERIC)) {
double d = cell.getNumericCellValue(); double d = cell.getNumericCellValue();
if (HSSFDateUtil.isCellDateFormatted(cell)) { if (HSSFDateUtil.isCellDateFormatted(cell)) {