Ticket #7032: workaround7032.2.diff

File workaround7032.2.diff, 2.2 KB (added by bastiK, 13 years ago)
  • src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

     
    11721172        return rv;
    11731173    }
    11741174
     1175    public Collection<OsmPrimitive> getSelected() {
     1176        DataSet ds = getCurrentDataSet();
     1177        if (ds == null) return null;
     1178        if (currentBaseNode != null && !ds.getSelected().isEmpty()) {
     1179            Way continueFrom = getWayForNode(currentBaseNode);
     1180            if (alt && continueFrom != null) {
     1181                return Collections.<OsmPrimitive>singleton(continueFrom);
     1182            }
     1183        }
     1184        return ds.getSelected();
     1185    }
     1186
    11751187    @Override
    11761188    public boolean layerIsSupported(Layer l) {
    11771189        return l instanceof OsmDataLayer;
  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

     
    7373
    7474import org.openstreetmap.josm.Main;
    7575import org.openstreetmap.josm.actions.JosmAction;
     76import org.openstreetmap.josm.actions.mapmode.DrawAction;
    7677import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
    7778import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting;
    7879import org.openstreetmap.josm.command.ChangeCommand;
     
    461462     * to the dataset, of course).
    462463     */
    463464    void add() {
    464         DataSet ds = Main.main.getCurrentDataSet();
    465         if (ds == null) return;
    466         Collection<OsmPrimitive> sel = ds.getSelected();
     465        Collection<OsmPrimitive> sel;
     466        if (Main.map.mapMode instanceof DrawAction) {
     467            sel = ((DrawAction) Main.map.mapMode).getSelected();
     468        } else {
     469            DataSet ds = Main.main.getCurrentDataSet();
     470            if (ds == null) return;
     471            sel = ds.getSelected();
     472        }
    467473        if (sel.isEmpty()) return;
    468474
    469475        JPanel p = new JPanel(new BorderLayout());