Changeset 18967 in josm


Ignore:
Timestamp:
2024-02-01T13:56:33+01:00 (3 months ago)
Author:
GerdP
Message:

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

  • disable the delete action in the relation editor if the relation has the status deleted
  • in DeleteCurrentRelationAction updateEnabledState() now uses getRelaion() instead of getRelationSnapshot(), similar to the actionPerformed() method
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

    r18804 r18967  
    157157    private final CancelAction cancelAction;
    158158    /**
     159     * Action for performing the {@link DeleteCurrentRelationAction}
     160     */
     161    private final DeleteCurrentRelationAction deleteAction;
     162    /**
    159163     * A list of listeners that need to be notified on clipboard content changes.
    160164     */
     
    266270        final DuplicateRelationAction duplicateAction = new DuplicateRelationAction(actionAccess);
    267271        // Action for performing the {@link DeleteCurrentRelationAction}
    268         final DeleteCurrentRelationAction deleteAction = new DeleteCurrentRelationAction(actionAccess);
     272        deleteAction = new DeleteCurrentRelationAction(actionAccess);
    269273
    270274        this.memberTableModel.addTableModelListener(applyAction);
     
    406410     * builds the panel with the OK and the Cancel button
    407411     * @param okAction OK action
     412     * @param deleteAction Delete action
    408413     * @param cancelAction Cancel action
    409414     *
     
    10771082    @Override
    10781083    public void commandChanged(int queueSize, int redoSize) {
     1084        deleteAction.updateEnabledState();
    10791085        Relation r = getRelation();
    10801086        if (r != null && r.getDataSet() == null) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DeleteCurrentRelationAction.java

    r14030 r18967  
    4040
    4141    @Override
    42     protected void updateEnabledState() {
    43         setEnabled(getEditor().getRelationSnapshot() != null);
     42    public void updateEnabledState() {
     43        Relation r = getEditor().getRelation();
     44        setEnabled(r != null && !r.isDeleted());
    4445    }
    4546
Note: See TracChangeset for help on using the changeset viewer.