Ignore:
Timestamp:
2018-05-13T01:32:56+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16260 - fix build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r13729 r13736  
    6363    private DataSet ds;
    6464    private final transient List<Relation> addedRelations = new LinkedList<>();
     65    private final boolean addUndoRedo;
    6566
    6667    /**
     
    457458    /**
    458459     * Constructs a new {@code JoinAreasAction} with optional shortcut and adapters.
    459      * @param addShortcutToolbarAdapters controls whether the shortcut should be registered or not, as for toolbar registration and adapters
     460     * @param addShortcutToolbarAdapters controls whether the shortcut should be registered or not,
     461     * as for toolbar registration, adapters creation and undo/redo integration
    460462     * @since 11611
    461463     */
     
    464466        Shortcut.registerShortcut("tools:joinareas", tr("Tool: {0}", tr("Join overlapping Areas")), KeyEvent.VK_J, Shortcut.SHIFT)
    465467        : null, addShortcutToolbarAdapters, null, addShortcutToolbarAdapters);
     468        addUndoRedo = addShortcutToolbarAdapters;
    466469    }
    467470
     
    566569            //FIXME: this is dirty hack
    567570            makeCommitsOneAction(tr("Reverting changes"));
    568             MainApplication.undoRedo.undo();
    569             MainApplication.undoRedo.redoCommands.clear();
     571            if (addUndoRedo) {
     572                MainApplication.undoRedo.undo();
     573                MainApplication.undoRedo.redoCommands.clear();
     574            }
    570575        }
    571576    }
     
    828833    }
    829834
    830     private static void commitCommand(Command c) {
    831         if (Main.main != null) {
     835    private void commitCommand(Command c) {
     836        if (Main.main != null && addUndoRedo) {
    832837            MainApplication.undoRedo.add(c);
    833838        } else {
     
    15961601    private void makeCommitsOneAction(String message) {
    15971602        cmds.clear();
    1598         if (Main.main != null) {
     1603        if (Main.main != null && addUndoRedo) {
    15991604            UndoRedoHandler ur = MainApplication.undoRedo;
    16001605            int i = Math.max(ur.commands.size() - cmdsCount, 0);
Note: See TracChangeset for help on using the changeset viewer.