Ignore:
Timestamp:
2008-07-05T14:12:34+02:00 (17 years ago)
Author:
stoecker
Message:

finished XML based translations of presets fixes #960
correct bounding box illegal access fixes #1044
do no longer modify objects when unnessesary (can result in 0 objects
modified in Undo :-)
correct typo fixes #730
some I18N corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r655 r679  
    4141       
    4242        public ChangePropertyCommand(Collection<OsmPrimitive> objects, String key, String value) {
    43                 this.objects = new LinkedList<OsmPrimitive>(objects);
     43                this.objects = new LinkedList<OsmPrimitive>();
    4444                this.key = key;
    4545                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                }
    4660        }
    4761
    4862        public ChangePropertyCommand(OsmPrimitive object, String key, String value) {
    49                 this.objects = new LinkedList<OsmPrimitive>(Collections.singleton(object));
     63                this.objects = new LinkedList<OsmPrimitive>();
    5064                this.key = key;
    5165                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);
    5270        }
    5371       
Note: See TracChangeset for help on using the changeset viewer.