Changeset 13736 in josm for trunk/src


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

see #16260 - fix build

Location:
trunk/src/org/openstreetmap/josm
Files:
3 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);
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r13729 r13736  
    107107    /**
    108108     * Event fired after a command has been added to the command queue.
    109      * @since xxx
     109     * @since 13729
    110110     */
    111111    public static final class CommandAddedEvent extends CommandQueueEvent {
     
    134134    /**
    135135     * Event fired after the command queue has been cleaned.
    136      * @since xxx
     136     * @since 13729
    137137     */
    138138    public static final class CommandQueueCleanedEvent extends CommandQueueEvent {
     
    161161    /**
    162162     * Event fired after a command has been undone.
    163      * @since xxx
     163     * @since 13729
    164164     */
    165165    public static final class CommandUndoneEvent extends CommandQueueEvent {
     
    188188    /**
    189189     * Event fired after a command has been redone.
    190      * @since xxx
     190     * @since 13729
    191191     */
    192192    public static final class CommandRedoneEvent extends CommandQueueEvent {
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r13729 r13736  
    3030import org.openstreetmap.josm.data.osm.UploadPolicy;
    3131import org.openstreetmap.josm.data.osm.Way;
    32 import org.openstreetmap.josm.gui.MainApplication;
    3332import org.openstreetmap.josm.io.IllegalDataException;
    3433import org.openstreetmap.josm.io.OsmReader;
     
    136135            optimizedWays.addAll(ways);
    137136        }
    138         // Clean command stack
    139         MainApplication.undoRedo.clean(data);
    140137        return optimizedWays;
    141138    }
Note: See TracChangeset for help on using the changeset viewer.