Changeset 2611 in josm


Ignore:
Timestamp:
2009-12-11T22:39:45+01:00 (10 years ago)
Author:
mjulius
Message:

fixes #4104 - reversing of way does not update direction dependent roles

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

Legend:

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

    r2070 r2611  
    1414import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1515import org.openstreetmap.josm.data.osm.Relation;
     16import org.openstreetmap.josm.data.osm.RelationMember;
    1617import org.openstreetmap.josm.gui.DefaultNameFormatter;
    1718import org.openstreetmap.josm.tools.ImageProvider;
     
    4950
    5051        oldRole = relation.getMember(position).getRole();
    51         relation.getMember(position).getRole().equals(newRole);
     52        relation.setMember(position, new RelationMember(newRole, relation.getMember(position).getMember()));
    5253
    5354        oldModified = relation.isModified();
  • trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

    r2573 r2611  
    1212import java.util.regex.Pattern;
    1313
    14 import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.command.Command;
    1615import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    142141        roleCorrectionMap.put(way, new ArrayList<RoleCorrection>());
    143142
    144         for (Relation relation : Main.main.getCurrentDataSet().getRelations()) {
     143        Collection<OsmPrimitive> referrers = oldway.getReferrers();
     144        for (OsmPrimitive referrer: referrers) {
     145            if (! (referrer instanceof Relation)) {
     146                continue;
     147            }
     148            Relation relation = (Relation)referrer;
    145149            int position = 0;
    146150            for (RelationMember member : relation.getMembers()) {
Note: See TracChangeset for help on using the changeset viewer.