Ticket #24703: 24703.patch
| File 24703.patch, 2.5 KB (added by , 26 hours ago) |
|---|
-
src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
878 878 * @param e the mouse event causing the action (mouse released) 879 879 */ 880 880 private void confirmOrUndoMovement(MouseEvent e) { 881 final Command lastCommand = UndoRedoHandler.getInstance().getLastCommand(); 882 if (lastCommand == null) { 883 Logging.warn("No command found in undo/redo history, skipping confirmOrUndoMovement"); 884 return; 885 } 886 881 887 if (movesHiddenWay()) { 882 888 final ConfirmMoveDialog ed = new ConfirmMoveDialog(); 883 889 ed.setContent(tr("Are you sure that you want to move elements with attached ways that are hidden by filters?")); … … 884 890 ed.toggleEnable("movedHiddenElements"); 885 891 showConfirmMoveDialog(ed); 886 892 } 893 // check if move was cancelled 894 if (UndoRedoHandler.getInstance().getLastCommand() != lastCommand) 895 return; 887 896 888 final Command lastCommand = UndoRedoHandler.getInstance().getLastCommand(); 889 if (lastCommand == null) { 890 Logging.warn("No command found in undo/redo history, skipping confirmOrUndoMovement"); 897 SelectAction.checkForDangerousMove(lastCommand); 898 899 // check if move was cancelled 900 if (UndoRedoHandler.getInstance().getLastCommand() != lastCommand) 891 901 return; 892 }893 902 894 903 SelectAction.checkCommandForLargeDistance(lastCommand); 895 904 … … 915 924 } 916 925 } 917 926 927 private static void checkForDangerousMove(Command lastCommand) { 928 if (lastCommand == null) { 929 return; 930 } 931 if (!checkAndConfirmOutlyingOperation("movenode", tr("Move confirmation"), 932 tr("You are about to move nodes that may have referrers that are not yet downloaded.") 933 + "<br/>" 934 + tr("This can lead to malformed geometries.") + "<br/>" 935 + tr("Do you really want to move?"), 936 "", 937 lastCommand.getParticipatingPrimitives(), null)) { 938 UndoRedoHandler.getInstance().undo(); 939 } 940 } 941 918 942 static void checkCommandForLargeDistance(Command lastCommand) { 919 943 if (lastCommand == null) { 920 944 return;
