Ticket #15676: currentselection.diff
File currentselection.diff, 2.1 KB (added by , 6 years ago) |
---|
-
src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
60 60 // Optional argument 'select' 61 61 private final Set<SimplePrimitiveId> toSelect = new HashSet<>(); 62 62 63 private Boolean isKeepingCurrentSelection = false; 64 63 65 @Override 64 66 public String getPermissionMessage() { 65 67 String msg = tr("Remote Control has been asked to load data from the API.") + … … 159 161 /** 160 162 * deselect objects if parameter addtags given 161 163 */ 162 if (args.containsKey("addtags") ) {164 if (args.containsKey("addtags") && !isKeepingCurrentSelection) { 163 165 GuiHelper.executeByMainWorkerInEDT(() -> { 164 166 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 165 167 if (ds == null) // e.g. download failed … … 184 186 forTagAdd.add(p); 185 187 } 186 188 } 189 if (isKeepingCurrentSelection) { 190 newSel.addAll(ds.getSelected()); 191 forTagAdd.addAll(ds.getSelected()); 192 } 187 193 toSelect.clear(); 194 isKeepingCurrentSelection = false; 188 195 ds.setSelected(newSel); 189 196 zoom(newSel, bbox); 190 197 MapFrame map = MainApplication.getMap(); … … 286 293 toSelect.clear(); 287 294 for (String item : args.get("select").split(",")) { 288 295 if (!item.isEmpty()) { 296 if (item.toLowerCase().equals("currentselection")) { 297 isKeepingCurrentSelection = true; 298 continue; 299 } 289 300 try { 290 301 toSelect.add(SimplePrimitiveId.fromString(item)); 291 302 } catch (IllegalArgumentException ex) {