Changeset 4302 in josm
- Timestamp:
- 2011-08-08T00:39:06+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r3910 r4302 6 6 7 7 import java.util.ArrayList; 8 import java.util.Arrays; 8 9 import java.util.Collection; 9 10 import java.util.Collections; … … 45 46 this.objects = new LinkedList<OsmPrimitive>(); 46 47 this.key = key; 47 this.value = value; 48 if (value == null) { 48 this.value = (value == null || value.isEmpty()) ? null : value; 49 if (this.value == null) { 49 50 for (OsmPrimitive osm : objects) { 50 51 if(osm.get(key) != null) { … … 55 56 for (OsmPrimitive osm : objects) { 56 57 String val = osm.get(key); 57 if (val == null || !value.equals(val)) { 58 if (val == null || !this.value.equals(val)) { 58 59 this.objects.add(osm); 59 60 } … … 63 64 64 65 public ChangePropertyCommand(OsmPrimitive object, String key, String value) { 65 this.objects = new LinkedList<OsmPrimitive>(); 66 this.key = key; 67 this.value = value; 68 String val = object.get(key); 69 if ((value == null && val != null) 70 || (value != null && (val == null || !value.equals(val)))) { 71 this.objects.add(object); 72 } 66 this(Arrays.asList(object), key, value); 73 67 } 74 68 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r4221 r4302 1495 1495 List<Command> cmds = new ArrayList<Command>(); 1496 1496 for (Tag tag: changedTags) { 1497 if (!tag.getValue().isEmpty()) { 1498 cmds.add(new ChangePropertyCommand(sel, tag.getKey(), tag.getValue())); 1499 } 1497 cmds.add(new ChangePropertyCommand(sel, tag.getKey(), tag.getValue())); 1500 1498 } 1501 1499
Note:
See TracChangeset
for help on using the changeset viewer.