src/ToCSV.java in poi2csv-0.0.2 vs src/ToCSV.java in poi2csv-0.0.3
- old
+ new
@@ -537,14 +537,18 @@
cell = row.getCell(i);
if(cell == null) {
csvLine.add("");
}
else {
- if(cell.getCellType() != Cell.CELL_TYPE_FORMULA) {
- csvLine.add(this.formatter.formatCellValue(cell));
- }
- else {
+ switch (cell.getCellType()) {
+ case Cell.CELL_TYPE_FORMULA:
csvLine.add(this.formatter.formatCellValue(cell, this.evaluator));
+ break;
+ case Cell.CELL_TYPE_ERROR:
+ csvLine.add("");
+ break;
+ default:
+ csvLine.add(this.formatter.formatCellValue(cell));
}
}
}
// Make a note of the index number of the right most cell. This value
// will later be used to ensure that the matrix of data in the CSV file