Ignore:
Timestamp:
2017-10-03T22:34:26+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm15320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java

    r33530 r33694  
    2424import org.openstreetmap.josm.command.SequenceCommand;
    2525import org.openstreetmap.josm.data.coor.EastNorth;
     26import org.openstreetmap.josm.data.osm.DataSet;
    2627import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
    2728import org.openstreetmap.josm.data.osm.MultipolygonBuilder;
     
    8586        List<OsmPrimitive> newSelection = new ArrayList<>();
    8687        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);
    8989        if (relationDeleteCommand == null)
    9090            return;
    9191
     92        DataSet ds = MainApplication.getLayerManager().getEditDataSet();
    9293        for (JoinedPolygon p : mpc.outerWays) {
    9394
     
    123124                }
    124125                if (relationReused) {
    125                     commands.add(new AddCommand(n));
     126                    commands.add(new AddCommand(ds, n));
    126127                } else {
    127128                    relationReused = true;
     
    189190            result.setKeys(tags);
    190191            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));
    192193        }
    193194
     
    199200        MainApplication.undoRedo.add(new SequenceCommand(tr("Reconstruct polygons from relation {0}",
    200201                r.getDisplayName(DefaultNameFormatter.getInstance())), commands));
    201         MainApplication.getLayerManager().getEditDataSet().setSelected(newSelection);
     202        ds.setSelected(newSelection);
    202203    }
    203204
Note: See TracChangeset for help on using the changeset viewer.