diff --git a/src/org/openstreetmap/josm/data/UndoRedoHandler.java b/src/org/openstreetmap/josm/data/UndoRedoHandler.java
index fb7ef80..fd3874c 100644
|
a
|
b
|
public class UndoRedoHandler implements MapView.LayerChangeListener {
|
| 65 | 65 | public void undo() { |
| 66 | 66 | if (commands.isEmpty()) |
| 67 | 67 | return; |
| 68 | | Collection<? extends OsmPrimitive> oldSelection = Main.main.getCurrentDataSet().getSelected(); |
| 69 | 68 | final Command c = commands.removeLast(); |
| 70 | 69 | c.undoCommand(); |
| 71 | 70 | redoCommands.push(c); |
| … |
… |
public class UndoRedoHandler implements MapView.LayerChangeListener {
|
| 74 | 73 | data.fireDataChange(); |
| 75 | 74 | } |
| 76 | 75 | fireCommandsChanged(); |
| 77 | | Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); |
| 78 | | if (!oldSelection.equals(newSelection)) { |
| 79 | | Main.main.getCurrentDataSet().fireSelectionChanged(); |
| 80 | | } |
| | 76 | // the undo may have changed the selection or modify selected items |
| | 77 | // so tell the listeners about the current situation |
| | 78 | Main.main.getCurrentDataSet().fireSelectionChanged(); |
| 81 | 79 | } |
| 82 | 80 | |
| 83 | 81 | /** |
| … |
… |
public class UndoRedoHandler implements MapView.LayerChangeListener {
|
| 87 | 85 | public void redo() { |
| 88 | 86 | if (redoCommands.isEmpty()) |
| 89 | 87 | return; |
| 90 | | Collection<? extends OsmPrimitive> oldSelection = Main.main.getCurrentDataSet().getSelected(); |
| 91 | 88 | final Command c = redoCommands.pop(); |
| 92 | 89 | c.executeCommand(); |
| 93 | 90 | commands.add(c); |
| … |
… |
public class UndoRedoHandler implements MapView.LayerChangeListener {
|
| 96 | 93 | data.fireDataChange(); |
| 97 | 94 | } |
| 98 | 95 | fireCommandsChanged(); |
| 99 | | Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); |
| 100 | | if (!oldSelection.equals(newSelection)) { |
| 101 | | Main.main.getCurrentDataSet().fireSelectionChanged(); |
| 102 | | } |
| | 96 | // the redo may have changed the selection or modify selected items |
| | 97 | // so tell the listeners about the current situation |
| | 98 | Main.main.getCurrentDataSet().fireSelectionChanged(); |
| 103 | 99 | } |
| 104 | 100 | |
| 105 | 101 | public void fireCommandsChanged() { |