Changeset 15072 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2019-05-11T22:23:33+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging/presets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
r14153 r15072 131 131 parser.mapOnStart("roles", Roles.class); 132 132 parser.map("role", Role.class); 133 parser.map ("checkgroup", CheckGroup.class);133 parser.mapBoth("checkgroup", CheckGroup.class); 134 134 parser.map("check", Check.class); 135 135 parser.map("combo", Combo.class); … … 167 167 XmlObjectParser parser = buildParser(); 168 168 169 /** to detect end of {@code <checkgroup>} */ 170 CheckGroup lastcheckgroup = null; 169 171 /** to detect end of {@code <group>} */ 170 172 TaggingPresetMenu lastmenu = null; … … 281 283 lastrole.roles.add((Role) o); 282 284 } else if (o instanceof Check) { 283 checks.add((Check) o); 285 if (lastcheckgroup != null) { 286 checks.add((Check) o); 287 } else { 288 all.getLast().data.add((TaggingPresetItem) o); 289 } 284 290 } else if (o instanceof ComboMultiSelect.PresetListEntry) { 285 291 listEntries.add((ComboMultiSelect.PresetListEntry) o); 286 292 } else if (o instanceof CheckGroup) { 287 all.getLast().data.add((TaggingPresetItem) o); 288 // Make sure list of checks is empty to avoid adding checks several times 289 // when used in chunks (fix #10801) 290 ((CheckGroup) o).checks.clear(); 291 ((CheckGroup) o).checks.addAll(checks); 292 checks.clear(); 293 CheckGroup cg = (CheckGroup) o; 294 if (cg == lastcheckgroup) { 295 lastcheckgroup = null; 296 all.getLast().data.add(cg); 297 // Make sure list of checks is empty to avoid adding checks several times 298 // when used in chunks (fix #10801) 299 cg.checks.clear(); 300 cg.checks.addAll(checks); 301 checks.clear(); 302 } else { 303 lastcheckgroup = cg; 304 } 293 305 } else { 294 306 if (!checks.isEmpty()) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java
r14214 r15072 113 113 @Override 114 114 public String toString() { 115 return "Check [ "115 return "Check [key=" + key + ", text=" + text + ", " 116 116 + (locale_text != null ? "locale_text=" + locale_text + ", " : "") 117 117 + (value_on != null ? "value_on=" + value_on + ", " : "")
Note:
See TracChangeset
for help on using the changeset viewer.