Ignore:
Timestamp:
2009-09-20T18:46:54+02:00 (10 years ago)
Author:
Gubaer
Message:

see #3557: Nodes not linked to their ways after combine (was: when converted from GPX)

File:
1 edited

Legend:

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

    r2166 r2173  
    109109            String msg = "";
    110110            switch(OsmPrimitiveType.from(primitive)) {
    111             case NODE: msg = "Delete node {0}"; break;
    112             case WAY: msg = "Delete way {0}"; break;
    113             case RELATION:msg = "Delete relation {0}"; break;
     111                case NODE: msg = "Delete node {0}"; break;
     112                case WAY: msg = "Delete way {0}"; break;
     113                case RELATION:msg = "Delete relation {0}"; break;
    114114            }
    115115
     
    130130            apiname = t.getAPIName();
    131131            switch(t) {
    132             case NODE: msg = trn("Delete {0} node", "Delete {0} nodes", toDelete.size(), toDelete.size()); break;
    133             case WAY: msg = trn("Delete {0} way", "Delete {0} ways", toDelete.size(), toDelete.size()); break;
    134             case RELATION: msg = trn("Delete {0} relation", "Delete {0} relations", toDelete.size(), toDelete.size()); break;
     132                case NODE: msg = trn("Delete {0} node", "Delete {0} nodes", toDelete.size(), toDelete.size()); break;
     133                case WAY: msg = trn("Delete {0} way", "Delete {0} ways", toDelete.size(), toDelete.size()); break;
     134                case RELATION: msg = trn("Delete {0} relation", "Delete {0} relations", toDelete.size(), toDelete.size()); break;
    135135            }
    136136        }
     
    231231     * <ul>
    232232     *    <li>it is untagged (see {@see Node#isTagged()}</li>
    233      *    <li>it is not referred to by other primitives outside of  <code>primitivesToDelete</code></li>
     233     *    <li>it is not referred to by other non-deleted primitives outside of  <code>primitivesToDelete</code></li>
    234234     * <ul>
    235235     * @param layer  the layer in whose context primitives are deleted
     
    251251                v.initialize();
    252252                n.visit(v);
    253                 v.getData().removeAll(primitivesToDelete);
    254                 if (v.getData().isEmpty()) {
     253                Collection<OsmPrimitive> referringPrimitives = v.getData();
     254                referringPrimitives.removeAll(primitivesToDelete);
     255                int count = 0;
     256                for (OsmPrimitive p : referringPrimitives) {
     257                    if (!p.isDeleted()) {
     258                        count++;
     259                    }
     260                }
     261                if (count == 0) {
    255262                    nodesToDelete.add(n);
    256263                }
Note: See TracChangeset for help on using the changeset viewer.