Ticket #7504: 7504.patch
File 7504.patch, 1.5 KB (added by , 13 years ago) |
---|
-
src/org/openstreetmap/josm/command/ChangePropertyCommand.java
113 113 super.executeCommand(); // save old 114 114 115 115 for (OsmPrimitive osm : objects) { 116 boolean modified = false; 117 118 // loop over all tags 116 // loop over all tags 119 117 for (Map.Entry<String, String> tag : this.tags.entrySet()) { 120 118 String oldVal = osm.get(tag.getKey()); 121 119 String newVal = tag.getValue(); 122 120 123 121 if (newVal == null || newVal.isEmpty()) { 124 if (oldVal != null) {122 if (oldVal != null) 125 123 osm.remove(tag.getKey()); 126 modified = true;127 }128 124 } 129 125 else if (oldVal == null || !newVal.equals(oldVal)) 130 126 osm.put(tag.getKey(), newVal); 131 modified = true;132 127 } 133 if (modified) 134 osm.setModified(true); 128 // init() only keeps modified primitives. Therefore the modified 129 // bit can be set without further checks. 130 osm.setModified(true); 135 131 } 136 132 return true; 137 133 }