Changeset 34072 in osm for applications/editors/josm/plugins/opendata/src/org
- Timestamp:
- 2018-02-19T23:17:09+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReader.java
r33518 r34072 58 58 if (row != null) { 59 59 List<String> result = new ArrayList<>(); 60 for (Cell cell : row) { 61 switch (cell.getCellType()) { 62 case Cell.CELL_TYPE_STRING: 63 result.add(cell.getRichStringCellValue().getString()); 64 break; 65 case Cell.CELL_TYPE_NUMERIC: 66 if (DateUtil.isCellDateFormatted(cell)) { 67 result.add(cell.getDateCellValue().toString()); 68 } else { 69 result.add(Double.toString(cell.getNumericCellValue())); 70 } 71 break; 72 case Cell.CELL_TYPE_BOOLEAN: 73 result.add(Boolean.toString(cell.getBooleanCellValue())); 74 break; 75 case Cell.CELL_TYPE_FORMULA: 76 result.add(cell.getCellFormula()); 77 break; 78 default: 79 result.add(""); 60 // Do not use iterator! It skips null values 61 for (int i = 0; i < row.getLastCellNum(); i++) { 62 Cell cell = row.getCell(i); 63 if (cell != null) { 64 switch (cell.getCellType()) { 65 case Cell.CELL_TYPE_STRING: 66 result.add(cell.getRichStringCellValue().getString()); 67 break; 68 case Cell.CELL_TYPE_NUMERIC: 69 if (DateUtil.isCellDateFormatted(cell)) { 70 result.add(cell.getDateCellValue().toString()); 71 } else { 72 result.add(Double.toString(cell.getNumericCellValue())); 73 } 74 break; 75 case Cell.CELL_TYPE_BOOLEAN: 76 result.add(Boolean.toString(cell.getBooleanCellValue())); 77 break; 78 case Cell.CELL_TYPE_FORMULA: 79 result.add(cell.getCellFormula()); 80 break; 81 default: 82 result.add(""); 83 } 84 } else { 85 result.add(""); 80 86 } 81 87 }
Note:
See TracChangeset
for help on using the changeset viewer.