Ignore:
Timestamp:
2014-03-19T13:25:23+01:00 (10 years ago)
Author:
akks
Message:

see #9832: move tags from ways to the multipolygons created by Shift-J

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r6807 r6913  
    324324     * @return a list of commands to execute
    325325     */
    326     private static List<Command> removeTagsFromWaysIfNeeded( Relation relation ) {
     326    public static List<Command> removeTagsFromWaysIfNeeded( Relation relation ) {
    327327        Map<String, String> values = new HashMap<String, String>(relation.getKeys());
    328328
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r6830 r6913  
    5252public class JoinAreasAction extends JosmAction {
    5353    // This will be used to commit commands and unite them into one large command sequence at the end
    54     private LinkedList<Command> cmds = new LinkedList<Command>();
     54    private final LinkedList<Command> cmds = new LinkedList<Command>();
    5555    private int cmdsCount = 0;
     56    private final LinkedList<Relation> addedRelations = new LinkedList<Relation>();
    5657
    5758    /**
     
    316317    public void actionPerformed(ActionEvent e) {
    317318        LinkedList<Way> ways = new LinkedList<Way>(Main.main.getCurrentDataSet().getSelectedWays());
    318 
     319        addedRelations.clear();
     320       
    319321        if (ways.isEmpty()) {
    320322            new Notification(
     
    373375
    374376            if (result.hasChanges) {
    375 
     377                // move tags from ways to newly created relations
     378                // TODO: do we need to also move tags for the modified relations?
     379                for (Relation r: addedRelations) {
     380                    cmds.addAll(CreateMultipolygonAction.removeTagsFromWaysIfNeeded(r));
     381                }
     382                commitCommands(tr("Move tags from ways to relations"));
     383               
    376384                List<Way> allWays = new ArrayList<Way>();
    377385                for (Multipolygon pol : result.polygons) {
     
    13071315        }
    13081316        cmds.add(new AddCommand(newRel));
     1317        addedRelations.add(newRel);
    13091318
    13101319        // We don't add outer to the relation because it will be handed to fixRelations()
Note: See TracChangeset for help on using the changeset viewer.