Changeset 2552 in josm for trunk/src/org
- Timestamp:
- 2009-11-30T00:02:22+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r2541 r2552 2 2 package org.openstreetmap.josm.data; 3 3 4 import java.util.ArrayList;5 4 import java.util.Collection; 6 5 import java.util.Iterator; … … 67 66 */ 68 67 public void undo() { 69 Collection<? extends OsmPrimitive> lastSelection = Main.main.getCurrentDataSet().getSelected();70 68 if (commands.isEmpty()) 71 69 return; 70 Collection<? extends OsmPrimitive> oldSelection = Main.main.getCurrentDataSet().getSelected(); 72 71 final Command c = commands.removeLast(); 73 72 c.undoCommand(); … … 78 77 } 79 78 fireCommandsChanged(); 80 List<OsmPrimitive> all = Main.main.getCurrentDataSet().allPrimitives(); 81 for (OsmPrimitive op : lastSelection) { 82 if (all.contains(op)) { 83 Main.main.getCurrentDataSet().addSelected(op); 84 } 79 Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); 80 if (!oldSelection.equals(newSelection)) { 81 Main.main.getCurrentDataSet().fireSelectionChanged(); 85 82 } 86 83 } … … 93 90 if (redoCommands.isEmpty()) 94 91 return; 92 Collection<? extends OsmPrimitive> oldSelection = Main.main.getCurrentDataSet().getSelected(); 95 93 final Command c = redoCommands.pop(); 96 94 c.executeCommand(); … … 101 99 } 102 100 fireCommandsChanged(); 101 Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); 102 if (!oldSelection.equals(newSelection)) { 103 Main.main.getCurrentDataSet().fireSelectionChanged(); 104 } 103 105 } 104 106
Note:
See TracChangeset
for help on using the changeset viewer.