Changeset 13434 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2018-02-18T05:02:23+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r13196 r13434 141 141 String upload = parser.getAttributeValue(null, "upload"); 142 142 if (upload != null) { 143 for (UploadPolicy policy : UploadPolicy.values()) { 144 if (policy.getXmlFlag().equalsIgnoreCase(upload)) { 145 ds.setUploadPolicy(policy); 146 break; 147 } 148 } 143 try { 144 ds.setUploadPolicy(UploadPolicy.of(upload)); 145 } catch (IllegalArgumentException e) { 146 throwException(MessageFormat.format("Illegal value for attribute ''upload''. Got ''{0}''.", upload), e); 147 } 148 } 149 if ("true".equalsIgnoreCase(parser.getAttributeValue(null, "read-only"))) { 150 ds.setReadOnly(); 149 151 } 150 152 String generator = parser.getAttributeValue(null, "generator"); … … 181 183 parseUnknown(); 182 184 } 183 } else if (event == XMLStreamConstants.END_ELEMENT) 185 } else if (event == XMLStreamConstants.END_ELEMENT) { 184 186 return; 187 } 185 188 } 186 189 } … … 618 621 progressMonitor.worked(1); 619 622 623 boolean readOnly = getDataSet().isReadOnly(); 624 620 625 progressMonitor.indeterminateSubTask(tr("Preparing data set...")); 626 if (readOnly) { 627 getDataSet().unsetReadOnly(); 628 } 621 629 prepareDataSet(); 630 if (readOnly) { 631 getDataSet().setReadOnly(); 632 } 622 633 progressMonitor.worked(1); 623 634 … … 628 639 pp.postprocessDataSet(getDataSet(), progressMonitor); 629 640 } 641 } 642 // Make sure postprocessors did not change the read-only state 643 if (readOnly && !getDataSet().isReadOnly()) { 644 getDataSet().setReadOnly(); 630 645 } 631 646 return getDataSet();
Note:
See TracChangeset
for help on using the changeset viewer.