Changeset 17215 in josm
- Timestamp:
- 2020-10-16T15:22:57+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/properties
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r17188 r17215 56 56 import org.openstreetmap.josm.actions.relation.DuplicateRelationAction; 57 57 import org.openstreetmap.josm.actions.relation.EditRelationAction; 58 import org.openstreetmap.josm.command.Change Command;58 import org.openstreetmap.josm.command.ChangeMembersCommand; 59 59 import org.openstreetmap.josm.command.ChangePropertyCommand; 60 60 import org.openstreetmap.josm.command.Command; … … 1154 1154 return; 1155 1155 1156 Relation rel= new Relation(cur);1156 Relation copy = new Relation(cur); 1157 1157 for (OsmPrimitive primitive: OsmDataManager.getInstance().getInProgressSelection()) { 1158 rel.removeMembersFor(primitive); 1159 } 1160 UndoRedoHandler.getInstance().add(new ChangeCommand(cur, rel)); 1158 copy.removeMembersFor(primitive); 1159 } 1160 UndoRedoHandler.getInstance().add(new ChangeMembersCommand(cur, copy.getMembers())); 1161 copy.setMembers(null); // see #19885 1161 1162 1162 1163 tagTable.clearSelection(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/RelationRoleEditor.java
r16549 r17215 9 9 import javax.swing.JOptionPane; 10 10 11 import org.openstreetmap.josm.command.Change Command;11 import org.openstreetmap.josm.command.ChangeMembersCommand; 12 12 import org.openstreetmap.josm.data.UndoRedoHandler; 13 13 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; … … 45 45 return; 46 46 } 47 final Relation newRelation = new Relation(relation); 48 final List<RelationMember> newMembers = newRelation.getMembers(); 47 final List<RelationMember> newMembers = relation.getMembers(); 49 48 newMembers.replaceAll(m -> members.contains(m) ? new RelationMember(newRole, m.getMember()) : m); 50 newRelation.setMembers(newMembers); 51 UndoRedoHandler.getInstance().add(new ChangeCommand(relation, newRelation)); 49 UndoRedoHandler.getInstance().add(new ChangeMembersCommand(relation, newMembers)); 52 50 } 53 51 }
Note:
See TracChangeset
for help on using the changeset viewer.