Changeset 36134 in osm
- Timestamp:
- 2023-09-07T18:20:01+02:00 (16 months ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java
r36132 r36134 978 978 979 979 private void removeAddressInterpolationWay() { 980 981 // Remove way - nodes of the way remain 982 commandGroup.add(DeleteCommand.delete(Collections.singleton(addrInterpolationWay))); 983 984 // Remove untagged nodes 985 for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) { 986 Node testNode = addrInterpolationWay.getNode(i); 987 if (!testNode.hasKeys()) { 988 commandGroup.add(DeleteCommand.delete(Collections.singleton(testNode))); 989 } 980 final Command deleteCommand = DeleteCommand.delete(Collections.singleton(addrInterpolationWay), true); 981 if (deleteCommand != null) { 982 commandGroup.add(deleteCommand); 990 983 } 991 984 -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/Building.java
r36132 r36134 487 487 addressCmds.add(new ChangeMembersCommand(r, members)); 488 488 } 489 addressCmds.add(DeleteCommand.delete(Collections.singleton(addrNode))); 489 final Command deleteCommand = DeleteCommand.delete(Collections.singleton(addrNode)); 490 if (deleteCommand != null) { 491 addressCmds.add(deleteCommand); 492 } 490 493 if (cmdList == null) { 491 494 Command c = new SequenceCommand(tr("Add address for building"), addressCmds); -
applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/MergeAddrPointsAction.java
r35669 r36134 38 38 import org.openstreetmap.josm.tools.Shortcut; 39 39 40 /** 41 * Merge address points with a building 42 */ 40 43 public class MergeAddrPointsAction extends JosmAction { 41 44 45 /** 46 * Merge the address point with the building 47 */ 42 48 public MergeAddrPointsAction() { 43 49 super(tr("Merge address points"), "mergeaddr", … … 173 179 } 174 180 if (!replaced.isEmpty()) { 175 cmds.add(new DeleteCommand(replaced.stream().map(p -> p.a).collect(Collectors.toList()))); 181 final Command deleteCommand = DeleteCommand.delete(replaced.stream().map(p -> p.a).collect(Collectors.toList())); 182 if (deleteCommand != null) { 183 cmds.add(deleteCommand); 184 } 176 185 } 177 186 -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MergeOverlapAction.java
r36132 r36134 225 225 } 226 226 if (!del.isEmpty()) { 227 cmds.add(DeleteCommand.delete(del)); 227 final Command deleteCommand = DeleteCommand.delete(del); 228 if (deleteCommand != null) { 229 cmds.add(deleteCommand); 230 } 228 231 } 229 232 -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java
r36132 r36134 174 174 candidateWay = tmp; 175 175 } 176 commands.add(DeleteCommand.delete(Collections.singleton(w))); 176 final Command deleteCommand = DeleteCommand.delete(Collections.singleton(w)); 177 if (deleteCommand != null) { 178 commands.add(deleteCommand); 179 } 177 180 } 178 181 } -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java
r36132 r36134 399 399 } 400 400 if (!foundOwnWay) { 401 commands.add(DeleteCommand.delete(Collections.singleton(source))); 401 final Command deleteCommand = DeleteCommand.delete(Collections.singleton(source)); 402 if (deleteCommand != null) { 403 commands.add(deleteCommand); 404 } 402 405 } 403 406 commands.addAll(relationCommands); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java
r36130 r36134 257 257 } 258 258 SplitWayCommand result = SplitWayCommand.splitWay( 259 selectedWay, wayChunks, Collections. <OsmPrimitive>emptyList());259 selectedWay, wayChunks, Collections.emptyList()); 260 260 if (splitWay != null) { 261 261 result.executeCommand(); 262 262 Command delCmd = DeleteCommand.delete(Collections.singletonList(splitWay)); 263 delCmd.executeCommand(); 264 UndoRedoHandler.getInstance().add(new SplitObjectCommand(Arrays.asList(result, delCmd)), false); 263 if (delCmd != null) { 264 delCmd.executeCommand(); 265 UndoRedoHandler.getInstance().add(new SplitObjectCommand(Arrays.asList(result, delCmd)), false); 266 } else { 267 UndoRedoHandler.getInstance().add(new SplitObjectCommand(Collections.singletonList(result)), false); 268 } 265 269 } else { 266 270 UndoRedoHandler.getInstance().add(result); … … 542 546 if (wayChunks != null) { 543 547 SplitWayCommand result = SplitWayCommand.splitWay( 544 way, wayChunks, Collections. <OsmPrimitive>emptyList());548 way, wayChunks, Collections.emptyList()); 545 549 result.executeCommand(); // relation members are overwritten/broken if there are multiple unapplied splits 546 550 splitCmds.add(result);
Note:
See TracChangeset
for help on using the changeset viewer.