Ticket #7032: workaround7032.2.diff
| File workaround7032.2.diff, 2.2 KB (added by , 13 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
1172 1172 return rv; 1173 1173 } 1174 1174 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 1175 1187 @Override 1176 1188 public boolean layerIsSupported(Layer l) { 1177 1189 return l instanceof OsmDataLayer; -
src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
73 73 74 74 import org.openstreetmap.josm.Main; 75 75 import org.openstreetmap.josm.actions.JosmAction; 76 import org.openstreetmap.josm.actions.mapmode.DrawAction; 76 77 import org.openstreetmap.josm.actions.search.SearchAction.SearchMode; 77 78 import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting; 78 79 import org.openstreetmap.josm.command.ChangeCommand; … … 461 462 * to the dataset, of course). 462 463 */ 463 464 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 } 467 473 if (sel.isEmpty()) return; 468 474 469 475 JPanel p = new JPanel(new BorderLayout());
