Ignore:
Timestamp:
2020-05-15T10:00:32+02:00 (5 years ago)
Author:
gerdp
Message:

see #josm17196: Undo changes inactive layer

  • change plugins which use direct access on UndoRedoHandler.getInstance().commands or UndoRedoHandler.getInstance().redoCommands

These fields should be private to allow a refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/splinex/src/org/openstreetmap/josm/plugins/Splinex/DrawSplineAction.java

    r34557 r35452  
    187187                        + ph.sn.cnext.north()) < EPSILON);
    188188            }
    189             if (ph.point == SplinePoint.ENDPOINT && !UndoRedoHandler.getInstance().commands.isEmpty()) {
    190                 Command cmd = UndoRedoHandler.getInstance().commands.getLast();
     189            if (ph.point == SplinePoint.ENDPOINT && UndoRedoHandler.getInstance().hasUndoCommands()) {
     190                Command cmd = UndoRedoHandler.getInstance().getLastCommand();
    191191                if (cmd instanceof MoveCommand) {
    192192                    mc = (MoveCommand) cmd;
     
    198198                }
    199199            }
    200             if (ph.point != SplinePoint.ENDPOINT && !UndoRedoHandler.getInstance().commands.isEmpty()) {
    201                 Command cmd = UndoRedoHandler.getInstance().commands.getLast();
     200            if (ph.point != SplinePoint.ENDPOINT && UndoRedoHandler.getInstance().hasUndoCommands()) {
     201                Command cmd = UndoRedoHandler.getInstance().getLastCommand();
    202202                if (!(cmd instanceof Spline.EditSplineCommand && ((Spline.EditSplineCommand) cmd).sn == ph.sn))
    203203                    dragControl = true;
     
    210210        }
    211211        if (spl.isClosed()) return;
    212         if (direction == 0)
    213             if (spl.nodeCount() < 2)
     212        if (direction == 0) {
     213            if (spl.nodeCount() < 2) {
    214214                direction = 1;
    215             else
     215            } else {
    216216                return;
     217            }
     218        }
    217219        Node n = null;
    218220        boolean existing = false;
Note: See TracChangeset for help on using the changeset viewer.