- Timestamp:
- 2011-02-18T09:49:28+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r3262 r3910 13 13 import javax.swing.JLabel; 14 14 15 import org.openstreetmap.josm.Main; 15 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 17 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 73 74 74 75 @Override public boolean executeCommand() { 75 super.executeCommand(); // save old 76 if (value == null) { 77 for (OsmPrimitive osm : objects) { 78 osm.setModified(true); 79 osm.remove(key); 76 Main.main.getCurrentDataSet().beginUpdate(); 77 try { 78 super.executeCommand(); // save old 79 if (value == null) { 80 for (OsmPrimitive osm : objects) { 81 osm.setModified(true); 82 osm.remove(key); 83 } 84 } else { 85 for (OsmPrimitive osm : objects) { 86 osm.setModified(true); 87 osm.put(key, value); 88 } 80 89 } 81 } else { 82 for (OsmPrimitive osm : objects) { 83 osm.setModified(true); 84 osm.put(key, value); 85 } 90 return true; 86 91 } 87 return true; 92 finally { 93 Main.main.getCurrentDataSet().endUpdate(); 94 } 88 95 } 89 96 -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r3479 r3910 74 74 return; 75 75 Collection<? extends OsmPrimitive> oldSelection = Main.main.getCurrentDataSet().getSelected(); 76 for (int i=1; i<=num; ++i) { 77 final Command c = commands.removeLast(); 78 c.undoCommand(); 79 redoCommands.addFirst(c); 80 if (commands.isEmpty()) { 81 break; 76 Main.main.getCurrentDataSet().beginUpdate(); 77 try { 78 for (int i=1; i<=num; ++i) { 79 final Command c = commands.removeLast(); 80 c.undoCommand(); 81 redoCommands.addFirst(c); 82 if (commands.isEmpty()) { 83 break; 84 } 82 85 } 86 } 87 finally { 88 Main.main.getCurrentDataSet().endUpdate(); 83 89 } 84 90 fireCommandsChanged();
Note:
See TracChangeset
for help on using the changeset viewer.