Changeset 15126 in josm


Ignore:
Timestamp:
2019-05-27T22:32:48+02:00 (5 months ago)
Author:
Don-vip
Message:

fix #15030 - make sure deleting a relation effectively removes it from selection

File:
1 edited

Legend:

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

    r14134 r15126  
    1111import java.util.Collections;
    1212import java.util.HashSet;
     13import java.util.List;
    1314import java.util.Set;
     15import java.util.stream.Collectors;
    1416
    1517import org.openstreetmap.josm.command.Command;
     
    356358        if (cmd != null) {
    357359            // cmd can be null if the user cancels dialogs DialogCommand displays
     360            List<Relation> toUnselect = toDelete.stream().filter(Relation::isSelected).collect(Collectors.toList());
    358361            UndoRedoHandler.getInstance().add(cmd);
    359             for (Relation relation : toDelete) {
    360                 if (layer.data.getSelectedRelations().contains(relation)) {
    361                     layer.data.toggleSelected(relation);
    362                 }
    363                 RelationDialogManager.getRelationDialogManager().close(layer, relation);
    364             }
     362            toDelete.forEach(relation -> RelationDialogManager.getRelationDialogManager().close(layer, relation));
     363            toUnselect.forEach(layer.data::toggleSelected);
    365364        }
    366365    }
Note: See TracChangeset for help on using the changeset viewer.