Ticket #22814: 22814.patch

File 22814.patch, 875 bytes (added by GerdP, 18 months ago)

add check to avoid a no-change-command on the undo/redo stack

  • src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

     
    605605            }
    606606            if (key.equals(newkey) && KeyedItem.DIFFERENT_I18N.equals(value))
    607607                return;
     608            if (value != null && key.equals(getEditItem(keys)) && m.size() == 1 && m.containsKey(getEditItem(values)))
     609                return; // see #22814: avoid to create a command that wouldn't change anything
    608610            if (key.equals(newkey) || value == null) {
    609611                UndoRedoHandler.getInstance().add(new ChangePropertyCommand(sel, newkey, value));
    610612                if (value != null) {