Changeset 11082 in josm
- Timestamp:
- 2016-10-06T12:43:24+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r10875 r11082 15 15 import java.util.ArrayList; 16 16 import java.util.Collection; 17 import java.util.Collections; 17 18 import java.util.LinkedList; 18 19 import java.util.List; … … 479 480 nodes.remove(candidateNode); 480 481 newWay.setNodes(nodes); 481 Main.main.undoRedo.add(new ChangeCommand(targetWay, newWay)); 482 if (nodes.size() < 2) { 483 final Command deleteCmd = DeleteCommand.delete(getLayerManager().getEditLayer(), Collections.singleton(targetWay), true); 484 if (deleteCmd != null) { 485 Main.main.undoRedo.add(deleteCmd); 486 } 487 } else { 488 Main.main.undoRedo.add(new ChangeCommand(targetWay, newWay)); 489 } 482 490 } else if (candidateNode.isTagged()) { 483 491 JOptionPane.showMessageDialog(Main.parent, … … 485 493 tr("Error"), JOptionPane.ERROR_MESSAGE); 486 494 } else { 487 List<Node> nodeList = new ArrayList<>(); 488 nodeList.add(candidateNode); 489 Command deleteCmd = DeleteCommand.delete(getLayerManager().getEditLayer(), nodeList, true); 495 final Command deleteCmd = DeleteCommand.delete(getLayerManager().getEditLayer(), Collections.singleton(candidateNode), true); 490 496 if (deleteCmd != null) { 491 497 Main.main.undoRedo.add(deleteCmd);
Note:
See TracChangeset
for help on using the changeset viewer.