Changeset 33694 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java
- Timestamp:
- 2017-10-03T22:34:26+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java
r33530 r33694 24 24 import org.openstreetmap.josm.command.SequenceCommand; 25 25 import org.openstreetmap.josm.data.coor.EastNorth; 26 import org.openstreetmap.josm.data.osm.DataSet; 26 27 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 27 28 import org.openstreetmap.josm.data.osm.MultipolygonBuilder; … … 85 86 List<OsmPrimitive> newSelection = new ArrayList<>(); 86 87 List<Command> commands = new ArrayList<>(); 87 Command relationDeleteCommand = DeleteCommand.delete( 88 MainApplication.getLayerManager().getEditLayer(), Collections.singleton(r), true, true); 88 Command relationDeleteCommand = DeleteCommand.delete(Collections.singleton(r), true, true); 89 89 if (relationDeleteCommand == null) 90 90 return; 91 91 92 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 92 93 for (JoinedPolygon p : mpc.outerWays) { 93 94 … … 123 124 } 124 125 if (relationReused) { 125 commands.add(new AddCommand( n));126 commands.add(new AddCommand(ds, n)); 126 127 } else { 127 128 relationReused = true; … … 189 190 result.setKeys(tags); 190 191 newSelection.add(candidateWay == null ? result : candidateWay); 191 commands.add(candidateWay == null ? new AddCommand( result) : new ChangeCommand(candidateWay, result));192 commands.add(candidateWay == null ? new AddCommand(ds, result) : new ChangeCommand(candidateWay, result)); 192 193 } 193 194 … … 199 200 MainApplication.undoRedo.add(new SequenceCommand(tr("Reconstruct polygons from relation {0}", 200 201 r.getDisplayName(DefaultNameFormatter.getInstance())), commands)); 201 MainApplication.getLayerManager().getEditDataSet().setSelected(newSelection);202 ds.setSelected(newSelection); 202 203 } 203 204
Note:
See TracChangeset
for help on using the changeset viewer.