Changeset 4475 in josm


Ignore:
Timestamp:
2011-09-29T00:42:28+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #6707 - Removing a empty polygon (removed shape first, then on validation error try to remove polygon)

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

Legend:

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

    r4348 r4475  
    316316            // cmd can be null if the user cancels dialogs DialogCommand displays
    317317            Main.main.undoRedo.add(cmd);
     318            if (getCurrentDataSet().getSelectedRelations().contains(toDelete)) {
     319                getCurrentDataSet().toggleSelected(toDelete);
     320            }
    318321            RelationDialogManager.getRelationDialogManager().close(layer, toDelete);
    319322        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r4459 r4475  
    329329        public void actionPerformed(ActionEvent e) {
    330330            if (!isEnabled()) return;
    331             int [] idx  = displaylist.getSelectedIndices();
    332             ArrayList<Relation> toDelete = new ArrayList<Relation>(idx.length);
    333             for (int i: idx) {
    334                 toDelete.add(model.getRelation(i));
    335             }
    336             for (Relation r: toDelete) {
    337                 deleteRelation(r);
     331            for (int i: displaylist.getSelectedIndices()) {
     332                deleteRelation(model.getRelation(i));
    338333            }
    339334        }
Note: See TracChangeset for help on using the changeset viewer.