Changeset 1753 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-07-08T22:58:37+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #2245: Merge layers doesn't update the "action" tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java

    r1750 r1753  
    168168    }
    169169
     170
    170171    private void fixWay(Way w) {
    171172        boolean replacedSomething = false;
    172173        LinkedList<Node> newNodes = new LinkedList<Node>();
    173         for (Node n : w.nodes) {
    174             Node otherN = (Node) merged.get(n);
    175             newNodes.add(otherN == null ? n : otherN);
    176             if (otherN != null) {
    177                 replacedSomething = true;
     174        for (Node myNode : w.nodes) {
     175            Node mergedNode = (Node) merged.get(myNode);
     176            if (mergedNode != null) {
     177                if (!mergedNode.deleted) {
     178                    newNodes.add(mergedNode);
     179                }
     180                replacedSomething =  true;
     181            } else {
     182                newNodes.add(myNode);
    178183            }
    179184        }
     
    187192        boolean replacedSomething = false;
    188193        LinkedList<RelationMember> newMembers = new LinkedList<RelationMember>();
    189         for (RelationMember m : r.members) {
    190             OsmPrimitive otherP = merged.get(m.member);
    191             if (otherP == null) {
    192                 newMembers.add(m);
     194        for (RelationMember myMember : r.members) {
     195            OsmPrimitive mergedMember = merged.get(myMember.member);
     196            if (mergedMember == null) {
     197                newMembers.add(myMember);
    193198            } else {
    194                 RelationMember mnew = new RelationMember(m);
    195                 mnew.member = otherP;
    196                 newMembers.add(mnew);
     199                if (! mergedMember.deleted) {
     200                    RelationMember newMember = new RelationMember(myMember);
     201                    newMember.member = mergedMember;
     202                    newMembers.add(newMember);
     203                }
    197204                replacedSomething = true;
    198205            }
Note: See TracChangeset for help on using the changeset viewer.