Changeset 1948 in josm for trunk/src


Ignore:
Timestamp:
2009-08-10T13:13:31+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3234: Update selection is broke for relations

File:
1 edited

Legend:

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

    r1937 r1948  
    150150    }
    151151
     152    protected void fixIncomplete(Way w) {
     153        if (!w.incomplete)return;
     154        if (w.incomplete && w.getNodesCount() == 0) return;
     155        for (Node n: w.getNodes()) {
     156            if (n.incomplete) return;
     157        }
     158        w.incomplete = false;
     159    }
     160
    152161    /**
    153162     * Postprocess the dataset and fix all merged references to point to the actual
     
    157166        for (Way w : myDataSet.ways) {
    158167            fixWay(w);
     168            fixIncomplete(w);
    159169        }
    160170        for (Relation r : myDataSet.relations) {
     
    243253                    //
    244254                    conflicts.add(my,other);
    245                 } else if (my.incomplete) {
     255                } else if (my.incomplete && !other.incomplete) {
    246256                    // my is incomplete, other completes it
    247257                    // => merge other onto my
     
    249259                    my.incomplete = false;
    250260                    my.cloneFrom(other);
     261                    merged.put(other, my);
     262                } else if (!my.incomplete && other.incomplete) {
     263                    // my is complete and the other is incomplete
     264                    // => keep mine, we have more information already
     265                    //
     266                    merged.put(other, my);
     267                } else if (my.incomplete && other.incomplete) {
     268                    // my and other are incomplete. Doesn't matter which one to
     269                    // take. We take mine.
     270                    //
    251271                    merged.put(other, my);
    252272                } else if (my.deleted && ! other.deleted && my.version == other.version) {
Note: See TracChangeset for help on using the changeset viewer.