- Timestamp:
- 2017-11-10T22:37:58+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r13107 r13108 173 173 174 174 try { 175 MainApplication.undoRedo.add(buildCommand()); 175 Command cmd = buildCommand(getLayerManager().getEditDataSet()); 176 if (cmd != null) { 177 MainApplication.undoRedo.add(cmd); 178 } 176 179 } catch (InvalidSelection except) { 177 180 Logging.debug(except); … … 184 187 /** 185 188 * Builds "align in line" command depending on the selected objects. 189 * @param ds data set in which the command operates 186 190 * @return the resulting command to execute to perform action 187 191 * @throws InvalidSelection if a polygon is selected, or if a node is used by 3 or more ways 188 * @since 12562 189 */ 190 public Command buildCommand() throws InvalidSelection { 191 DataSet ds = getLayerManager().getEditDataSet(); 192 * @since 13108 193 */ 194 public Command buildCommand(DataSet ds) throws InvalidSelection { 192 195 List<Node> selectedNodes = new ArrayList<>(ds.getSelectedNodes()); 193 196 List<Way> selectedWays = new ArrayList<>(ds.getSelectedWays()); … … 276 279 throw new InvalidSelection(tr("Intersection of three or more ways can not be solved. Abort.")); 277 280 } 278 return new SequenceCommand(tr("Align Nodes in Line"), cmds); 281 return cmds.isEmpty() ? null : new SequenceCommand(tr("Align Nodes in Line"), cmds); 279 282 } 280 283
Note:
See TracChangeset
for help on using the changeset viewer.