Changeset 35407 in osm for applications/editors/josm/plugins/reverter
- Timestamp:
- 2020-04-04T07:29:00+02:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/reverter/src/reverter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r35402 r35407 53 53 54 54 private void addChangeCommandIfNotEquals(OsmPrimitive target, OsmPrimitive newTarget, boolean nominal) { 55 if (!target.hasEqualSemanticAttributes(newTarget) || target.isDeleted() != newTarget.isDeleted()56 57 55 if (target.isIncomplete() != newTarget.isIncomplete() || target.isDeleted() != newTarget.isDeleted() 56 || target.isVisible() != newTarget.isVisible() 57 || !getNonDiscardableTags(target).equals(getNonDiscardableTags(newTarget))) { 58 58 cmds.add(new ChangeCommand(target, newTarget)); 59 59 if (nominal) { -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetCommand.java
r35400 r35407 19 19 * Create the command by specifying the list of commands to execute. 20 20 * @param name The description text 21 * @param sequenz The sequence that was alreadyexecuted.21 * @param sequenz The sequence that should be executed. 22 22 */ 23 23 public RevertChangesetCommand(String name, Collection<Command> sequenz) { 24 24 super(name, sequenz); 25 25 ReverterPlugin.reverterUsed = true; 26 setSequenceComplete(true);27 26 } 28 27 … … 37 36 } 38 37 39 @Override40 public void undoCommand() {41 getAffectedDataSet().update(super::undoCommand);42 }43 44 @Override45 public boolean executeCommand() {46 return getAffectedDataSet().update(super::executeCommand);47 }48 49 38 } -
applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetTask.java
r35400 r35407 15 15 16 16 import org.openstreetmap.josm.command.Command; 17 import org.openstreetmap.josm.command.SequenceCommand; 17 18 import org.openstreetmap.josm.command.conflict.ConflictAddCommand; 18 19 import org.openstreetmap.josm.data.UndoRedoHandler; … … 98 99 newLayer = false; // reuse layer for subsequent reverts 99 100 } catch (OsmTransferException e) { 100 if (!allcmds.isEmpty()) { 101 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size())); 102 } 103 Logging.error(e); 101 Logging.error(e); 104 102 throw e; 105 103 } catch (UserCancelException e) { 106 if (!allcmds.isEmpty()) {107 GuiHelper.runInEDT(() -> UndoRedoHandler.getInstance().undo(allcmds.size()));108 }109 104 Logging.warn("Revert canceled"); 110 105 Logging.trace(e); … … 113 108 } 114 109 if (!allcmds.isEmpty()) { 115 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new RevertChangesetCommand(tr("Revert changesets"), allcmds);110 Command cmd = allcmds.size() == 1 ? allcmds.get(0) : new SequenceCommand(tr("Revert changesets"), allcmds); 116 111 GuiHelper.runInEDT(() -> { 117 UndoRedoHandler.getInstance().add(cmd , false);112 UndoRedoHandler.getInstance().add(cmd); 118 113 if (numberOfConflicts > 0) { 119 114 MainApplication.getMap().conflictDialog.warnNumNewConflicts(numberOfConflicts); … … 174 169 numberOfConflicts++; 175 170 } 176 c.executeCommand();177 171 } 178 172 final String desc;
Note:
See TracChangeset
for help on using the changeset viewer.