Changeset 29298 in osm for applications/editors/josm/plugins/opendata/src/org
- Timestamp:
- 2013-03-02T00:32:50+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReader.java
r28113 r29298 24 24 import org.jopendocument.model.office.OfficeSpreadsheet; 25 25 import org.jopendocument.model.table.TableTable; 26 import org.jopendocument.model.table.TableTableCell; 26 27 import org.jopendocument.model.table.TableTableRow; 28 import org.jopendocument.model.text.TextP; 27 29 import org.openstreetmap.josm.data.osm.DataSet; 28 30 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 36 38 private int rowIndex; 37 39 38 private static final String SEP = "TextP: \\[";40 private static final String SEP = "TextP:["; 39 41 40 42 public OdsReader(SpreadSheetHandler handler) { … … 79 81 List<String> result = new ArrayList<String>(); 80 82 boolean allFieldsBlank = true; 81 for (String text : row.getText().replaceFirst(SEP, "").replaceAll("\\]", "").replaceAll("null", SEP).split(SEP)) { 82 result.add(text); 83 if (allFieldsBlank && !text.isEmpty()) { 84 allFieldsBlank = false; 85 } 83 for (TableTableCell cell : row.getAllCells()) { 84 TextP textP = cell.getTextP(); 85 String text = textP == null ? "" : textP.toString().replace(SEP, "").replace("]", "").replace("null", "").trim(); 86 result.add(text); 87 if (allFieldsBlank && !text.isEmpty()) { 88 allFieldsBlank = false; 89 } 86 90 } 87 91
Note:
See TracChangeset
for help on using the changeset viewer.