Changeset 18968 in josm


Ignore:
Timestamp:
2024-02-02T15:25:09+01:00 (3 months ago)
Author:
GerdP
Message:

fix #23447:Fatal "crash" attempting to delete all "Outer" members & then multipolygon

  • revert changes from r18967
  • simply close relation editor dialog for the already deleted relation instead of generating an additional delete command
Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
2 edited

Legend:

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

    r18967 r18968  
    157157    private final CancelAction cancelAction;
    158158    /**
    159      * Action for performing the {@link DeleteCurrentRelationAction}
    160      */
    161     private final DeleteCurrentRelationAction deleteAction;
    162     /**
    163159     * A list of listeners that need to be notified on clipboard content changes.
    164160     */
     
    270266        final DuplicateRelationAction duplicateAction = new DuplicateRelationAction(actionAccess);
    271267        // Action for performing the {@link DeleteCurrentRelationAction}
    272         deleteAction = new DeleteCurrentRelationAction(actionAccess);
     268        final DeleteCurrentRelationAction deleteAction = new DeleteCurrentRelationAction(actionAccess);
    273269
    274270        this.memberTableModel.addTableModelListener(applyAction);
     
    410406     * builds the panel with the OK and the Cancel button
    411407     * @param okAction OK action
    412      * @param deleteAction Delete action
    413408     * @param cancelAction Cancel action
    414409     *
     
    10821077    @Override
    10831078    public void commandChanged(int queueSize, int redoSize) {
    1084         deleteAction.updateEnabledState();
    10851079        Relation r = getRelation();
    10861080        if (r != null && r.getDataSet() == null) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java

    r18967 r18968  
    99import org.openstreetmap.josm.actions.mapmode.DeleteAction;
    1010import org.openstreetmap.josm.data.osm.Relation;
     11import org.openstreetmap.josm.gui.MainApplication;
    1112import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor;
     13import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager;
     14import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1215import org.openstreetmap.josm.tools.ImageProvider;
    1316
     
    3639        if (toDelete == null)
    3740            return;
     41        if (toDelete.isDeleted()) {
     42            // see #23447
     43            OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
     44            if (layer != null) {
     45                RelationDialogManager.getRelationDialogManager().close(layer, toDelete);
     46            }
     47            return;
     48        }
    3849        DeleteAction.deleteRelation(getLayer(), toDelete);
    3950    }
    4051
    4152    @Override
    42     public void updateEnabledState() {
    43         Relation r = getEditor().getRelation();
    44         setEnabled(r != null && !r.isDeleted());
     53    protected void updateEnabledState() {
     54        setEnabled(getEditor().getRelationSnapshot() != null);
    4555    }
    4656
Note: See TracChangeset for help on using the changeset viewer.