Changeset 4885 in josm for trunk


Ignore:
Timestamp:
2012-02-01T20:12:46+01:00 (8 years ago)
Author:
simon04
Message:

#fix #7344 - Deleting multiple relations ends in failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r4795 r4885  
    1616import java.util.HashSet;
    1717import java.util.Iterator;
     18import java.util.LinkedList;
    1819import java.util.List;
    1920import java.util.Set;
     
    337338
    338339        public void actionPerformed(ActionEvent e) {
    339             if (!isEnabled()) return;
    340             for (int i: displaylist.getSelectedIndices()) {
    341                 deleteRelation(model.getRelation(i));
    342             }
     340            if (!isEnabled()) {
     341                return;
     342            }
     343            List<Relation> toDelete = new LinkedList<Relation>();
     344            for (int i : displaylist.getSelectedIndices()) {
     345                toDelete.add(model.getRelation(i));
     346            }
     347            for (Relation r : toDelete) {
     348                deleteRelation(r);
     349            }
     350            displaylist.clearSelection();
    343351        }
    344352
Note: See TracChangeset for help on using the changeset viewer.