Changeset 15072 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/defaultpresets.xml
r15062 r15072 1031 1031 <text key="step_count" text="Amount of Steps" /> 1032 1032 <space /> 1033 <checkgroup columns="1" > <!-- workaround --> 1034 <check key="ramp" text="Ramp" /> 1035 </checkgroup> 1033 <check key="ramp" text="Ramp" /> 1036 1034 <checkgroup columns="2" > 1037 1035 <check key="ramp:stroller" text="Stroller ramp" /> … … 1041 1039 <combo key="ramp:luggage" text="Luggage ramp" values="yes,automatic,manual,no" /> 1042 1040 <space /> 1043 <checkgroup columns="1" > <!-- workaround --> 1044 <check key="handrail" text="Handrail" /> 1045 </checkgroup> 1041 <check key="handrail" text="Handrail" /> 1046 1042 <checkgroup columns="3" > 1047 1043 <check key="handrail:left" text="Left handrail" /> -
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.