Changeset 14542 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-12-09T23:58:32+01:00 (6 years ago)
Author:
Don-vip
Message:

see #17040 - fix unit tests

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

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

    r14397 r14542  
    130130        if (!isEnabled())
    131131            return;
    132 
    133         DataSet ds = getLayerManager().getEditDataSet();
     132        runOn(getLayerManager().getEditDataSet());
     133    }
     134
     135    /**
     136     * Run the action on the given dataset.
     137     * @param ds dataset
     138     * @since 14542
     139     */
     140    public static void runOn(DataSet ds) {
    134141        Collection<OsmPrimitive> sel = ds.getSelected();
    135142        List<Node> nodes = OsmPrimitive.getFilteredList(sel, Node.class);
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r14397 r14542  
    2626import org.openstreetmap.josm.command.SplitWayCommand;
    2727import org.openstreetmap.josm.data.UndoRedoHandler;
     28import org.openstreetmap.josm.data.osm.DataSet;
    2829import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
    2930import org.openstreetmap.josm.data.osm.Node;
     
    6667    @Override
    6768    public void actionPerformed(ActionEvent e) {
     69        runOn(getLayerManager().getEditDataSet());
     70    }
     71
     72    /**
     73     * Run the action on the given dataset.
     74     * @param ds dataset
     75     * @since 14542
     76     */
     77    public static void runOn(DataSet ds) {
    6878
    6979        if (SegmentToKeepSelectionDialog.DISPLAY_COUNT.get() > 0) {
     
    7383        }
    7484
    75         Collection<OsmPrimitive> selection = getLayerManager().getEditDataSet().getSelected();
     85        Collection<OsmPrimitive> selection = ds.getSelected();
    7686
    7787        List<Node> selectedNodes = OsmPrimitive.getFilteredList(selection, Node.class);
     
    284294        List<? extends PrimitiveId> newSel = result.getNewSelection();
    285295        if (newSel != null && !newSel.isEmpty()) {
    286             MainApplication.getLayerManager().getEditDataSet().setSelected(newSel);
     296            way.getDataSet().setSelected(newSel);
    287297        }
    288298    }
Note: See TracChangeset for help on using the changeset viewer.