Changeset 6715 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2014-01-17T19:36:31+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolutionUtil.java
r6362 r6715 2 2 package org.openstreetmap.josm.gui.conflict.tags; 3 3 4 import java.util.ArrayList; 4 5 import java.util.Collection; 5 6 … … 25 26 * For tags which are not present on at least one of the merged nodes, the empty value "" 26 27 * is added to the list of values for this tag, but only if there are at least two 27 * primitives with tags .28 * primitives with tags, and at least one tagged primitive do not have this tag. 28 29 * 29 30 * @param tc the tag collection 30 * @param merged the collection of merged 31 * @param merged the collection of merged primitives 31 32 */ 32 33 public static void normalizeTagCollectionBeforeEditing(TagCollection tc, Collection<? extends OsmPrimitive> merged) { … … 37 38 } 38 39 39 int numNodesWithTags = 0;40 Collection<OsmPrimitive> taggedPrimitives = new ArrayList<OsmPrimitive>(); 40 41 for (OsmPrimitive p: merged) { 41 if ( !p.getKeys().isEmpty()) {42 numNodesWithTags++;42 if (p.isTagged()) { 43 taggedPrimitives.add(p); 43 44 } 44 45 } 45 if ( numNodesWithTags<= 1)46 if (taggedPrimitives.size() <= 1) 46 47 return; 47 48 … … 50 51 // on all merged nodes 51 52 // 52 for (OsmPrimitive p: merged) {53 for (OsmPrimitive p: taggedPrimitives) { 53 54 if (p.get(key) == null) { 54 55 tc.add(new Tag(key, "")); // add a tag with key and empty value
Note:
See TracChangeset
for help on using the changeset viewer.