Changeset 11252 in josm for trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
- Timestamp:
- 2016-11-13T14:49:39+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r11240 r11252 760 760 return; 761 761 case 1: 762 Main.main.undoRedo.add(cmds.getFirst());762 commitCommand(cmds.getFirst()); 763 763 break; 764 764 default: 765 Command c = new SequenceCommand(tr(description), cmds); 766 Main.main.undoRedo.add(c); 765 commitCommand(new SequenceCommand(tr(description), cmds)); 767 766 break; 768 767 } … … 770 769 cmds.clear(); 771 770 cmdsCount++; 771 } 772 773 private static void commitCommand(Command c) { 774 if (Main.main != null) { 775 Main.main.undoRedo.add(c); 776 } else { 777 c.executeCommand(); 778 } 772 779 } 773 780 … … 1279 1286 if (!way.insideToTheRight) { 1280 1287 ReverseWayResult res = ReverseWayAction.reverseWay(way.way); 1281 Main.main.undoRedo.add(res.getReverseCommand());1288 commitCommand(res.getReverseCommand()); 1282 1289 cmdsCount++; 1283 1290 } … … 1286 1293 Pair<Way, Command> result = CombineWayAction.combineWaysWorker(actionWays); 1287 1294 1288 Main.main.undoRedo.add(result.b);1295 commitCommand(result.b); 1289 1296 cmdsCount++; 1290 1297 … … 1536 1543 */ 1537 1544 private void makeCommitsOneAction(String message) { 1538 UndoRedoHandler ur = Main.main.undoRedo;1539 1545 cmds.clear(); 1540 int i = Math.max(ur.commands.size() - cmdsCount, 0); 1541 for (; i < ur.commands.size(); i++) { 1542 cmds.add(ur.commands.get(i)); 1543 } 1544 1545 for (i = 0; i < cmds.size(); i++) { 1546 ur.undo(); 1546 if (Main.main != null) { 1547 UndoRedoHandler ur = Main.main.undoRedo; 1548 int i = Math.max(ur.commands.size() - cmdsCount, 0); 1549 for (; i < ur.commands.size(); i++) { 1550 cmds.add(ur.commands.get(i)); 1551 } 1552 1553 for (i = 0; i < cmds.size(); i++) { 1554 ur.undo(); 1555 } 1547 1556 } 1548 1557
Note:
See TracChangeset
for help on using the changeset viewer.
