Changeset 11684 in josm for trunk


Ignore:
Timestamp:
2017-03-05T02:38:09+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #14193 - make sure deleted objects are not added to relations, do not create useless commands if as a result, the relation is not changed

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/relation
Files:
2 edited

Legend:

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

    r11339 r11684  
    1313import java.util.TreeSet;
    1414import java.util.concurrent.CopyOnWriteArrayList;
     15import java.util.stream.Collectors;
    1516
    1617import javax.swing.DefaultListSelectionModel;
     
    357358     */
    358359    public void applyToRelation(Relation relation) {
    359         relation.setMembers(members);
     360        relation.setMembers(members.stream()
     361                .filter(rm -> !rm.getMember().isDeleted()).collect(Collectors.toList()));
    360362    }
    361363
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SavingAction.java

    r11120 r11684  
    105105        tagEditorModel.applyToPrimitive(editedRelation);
    106106        memberTableModel.applyToRelation(editedRelation);
    107         Main.main.undoRedo.add(new ChangeCommand(editor.getRelation(), editedRelation));
    108         layer.data.fireSelectionChanged();
     107        if (!editedRelation.hasEqualSemanticAttributes(editor.getRelation(), false)) {
     108            Main.main.undoRedo.add(new ChangeCommand(editor.getRelation(), editedRelation));
     109            layer.data.fireSelectionChanged();
     110        }
    109111    }
    110112
Note: See TracChangeset for help on using the changeset viewer.