Ignore:
Timestamp:
2009-12-27T16:51:22+01:00 (14 years ago)
Author:
mjulius
Message:

fixes #4149 - exception when undoing reversal of way with tag corrections

don't try to undo Command for a primitive that does not belong to a dataset

fixes issue with ChangeRelationMemberRoleCommand.undoCommand() doing nothing except resetting modified flag
don't reverse tags on way nodes when reversing way
reversing way now also reverses 'incline=*' tags

Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

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

    r2611 r2683  
    5050
    5151        oldRole = relation.getMember(position).getRole();
     52        if (newRole.equals(oldRole)) return true;
    5253        relation.setMember(position, new RelationMember(newRole, relation.getMember(position).getMember()));
    5354
     
    5859
    5960    @Override public void undoCommand() {
    60         relation.getMember(position).getRole().equals(oldRole);
     61        relation.setMember(position, new RelationMember(oldRole, relation.getMember(position).getMember()));
    6162        relation.setModified(oldModified);
    6263    }
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r2512 r2683  
    9292    public void undoCommand() {
    9393        for (Entry<OsmPrimitive, PrimitiveData> e : cloneMap.entrySet()) {
    94             e.getKey().load(e.getValue());
     94            OsmPrimitive primitive = e.getKey();
     95            if (primitive.getDataSet() != null) {
     96                e.getKey().load(e.getValue());
     97            }
    9598        }
    9699    }
Note: See TracChangeset for help on using the changeset viewer.