- Timestamp:
- 2013-05-29T00:21:13+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r5903 r5972 24 24 import java.util.Collection; 25 25 import java.util.Collections; 26 import java.util.EnumSet; 26 27 import java.util.HashMap; 27 28 import java.util.HashSet; … … 82 83 import org.openstreetmap.josm.gui.tagging.TagEditorPanel; 83 84 import org.openstreetmap.josm.gui.tagging.TagModel; 85 import org.openstreetmap.josm.gui.tagging.TaggingPreset; 84 86 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; 85 87 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; … … 753 755 public static Command addPrimitivesToRelation(final Relation orig, Collection<? extends OsmPrimitive> primitivesToAdd) { 754 756 try { 757 final Collection<TaggingPreset> presets = TaggingPreset.getMatchingPresets(EnumSet.of(TaggingPreset.PresetType.RELATION), orig.getKeys(), false); 755 758 Relation relation = new Relation(orig); 756 759 boolean modified = false; … … 763 766 continue; 764 767 } 765 relation.addMember(new RelationMember("", p)); 768 final String role = presets.isEmpty() ? null : presets.iterator().next().suggestRoleForOsmPrimitive(p); 769 relation.addMember(new RelationMember(role == null ? "" : role, p)); 766 770 modified = true; 767 771 }
Note:
See TracChangeset
for help on using the changeset viewer.