Changeset 679 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2008-07-05T14:12:34+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r655 r679 41 41 42 42 public ChangePropertyCommand(Collection<OsmPrimitive> objects, String key, String value) { 43 this.objects = new LinkedList<OsmPrimitive>( objects);43 this.objects = new LinkedList<OsmPrimitive>(); 44 44 this.key = key; 45 45 this.value = value; 46 if (value == null) { 47 for (OsmPrimitive osm : objects) { 48 if(osm.get(key) != null) 49 this.objects.add(osm); 50 } 51 } else { 52 for (OsmPrimitive osm : objects) { 53 String val = osm.get(key); 54 if(val == null || !value.equals(val)) 55 { 56 this.objects.add(osm); 57 } 58 } 59 } 46 60 } 47 61 48 62 public ChangePropertyCommand(OsmPrimitive object, String key, String value) { 49 this.objects = new LinkedList<OsmPrimitive>( Collections.singleton(object));63 this.objects = new LinkedList<OsmPrimitive>(); 50 64 this.key = key; 51 65 this.value = value; 66 String val = object.get(key); 67 if ((value == null && val != null) 68 || (value != null && (val == null || !value.equals(val)))) 69 this.objects.add(object); 52 70 } 53 71
Note:
See TracChangeset
for help on using the changeset viewer.