Changeset 10174 in josm
- Timestamp:
- 2016-05-10T16:09:21+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r10043 r10174 959 959 Collections.<OsmPrimitive>emptyList(), SplitWayAction.Strategy.keepFirstChunk()); 960 960 961 //execute the command, we need the results 962 cmds.add(split.getCommand()); 963 commitCommands(marktr("Split ways into fragments")); 964 965 result.add(split.getOriginalWay()); 966 result.addAll(split.getNewWays()); 967 } else { 961 if (split != null) { 962 //execute the command, we need the results 963 cmds.add(split.getCommand()); 964 commitCommands(marktr("Split ways into fragments")); 965 966 result.add(split.getOriginalWay()); 967 result.addAll(split.getNewWays()); 968 } 969 } 970 if (result.isEmpty()) { 968 971 //nothing to split 969 972 result.add(way); -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r10131 r10174 746 746 public static SplitWayResult split(OsmDataLayer layer, Way way, List<Node> atNodes, Collection<? extends OsmPrimitive> selection) { 747 747 List<List<Node>> chunks = buildSplitChunks(way, atNodes); 748 if (chunks == null) return null; 749 return splitWay(layer, way, chunks, selection); 748 return chunks != null ? splitWay(layer, way, chunks, selection) : null; 750 749 } 751 750 -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r9989 r10174 8 8 import java.awt.GridBagLayout; 9 9 import java.util.ArrayList; 10 import java.util.Arrays; 10 11 import java.util.Collection; 11 12 import java.util.Collections; … … 27 28 import org.openstreetmap.josm.Main; 28 29 import org.openstreetmap.josm.actions.SplitWayAction; 30 import org.openstreetmap.josm.actions.SplitWayAction.SplitWayResult; 29 31 import org.openstreetmap.josm.data.osm.Node; 30 32 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 470 472 return new ChangeCommand(ws.way, wnew); 471 473 } else { 472 List<List<Node>> chunks = new ArrayList<>(2); 473 chunks.add(n1); 474 chunks.add(n2); 475 return SplitWayAction.splitWay(layer, ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand(); 474 SplitWayResult split = SplitWayAction.splitWay(layer, ws.way, Arrays.asList(n1, n2), Collections.<OsmPrimitive>emptyList()); 475 return split != null ? split.getCommand() : null; 476 476 } 477 477 }
Note:
See TracChangeset
for help on using the changeset viewer.