Ignore:
Timestamp:
2015-10-17T18:39:12+02:00 (4 years ago)
Author:
simon04
Message:

see #11858 - Improve way accuracy: when deleting a node which is referenced in other objects, detach from way

Instead of nagging that it cannot be deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r8840 r8892  
    445445                List<Way> ways = OsmPrimitive.getFilteredList(referrers, Way.class);
    446446                if (referrers.size() != 1 || ways.size() != 1) {
    447                     JOptionPane.showMessageDialog(Main.parent,
    448                             tr("Cannot delete node that is referenced by multiple objects"),
    449                             tr("Error"), JOptionPane.ERROR_MESSAGE);
     447                    // detach node from way
     448                    final Way newWay = new Way(targetWay);
     449                    final List<Node> nodes = newWay.getNodes();
     450                    nodes.remove(candidateNode);
     451                    newWay.setNodes(nodes);
     452                    Main.main.undoRedo.add(new ChangeCommand(targetWay, newWay));
    450453                } else if (candidateNode.isTagged()) {
    451454                    JOptionPane.showMessageDialog(Main.parent,
Note: See TracChangeset for help on using the changeset viewer.