- Timestamp:
- 2020-12-13T16:04:00+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
r17358 r17406 26 26 import org.openstreetmap.josm.actions.relation.DownloadSelectedIncompleteMembersAction; 27 27 import org.openstreetmap.josm.command.AddCommand; 28 import org.openstreetmap.josm.command.ChangeCommand; 28 29 import org.openstreetmap.josm.command.ChangeMembersCommand; 29 30 import org.openstreetmap.josm.command.ChangePropertyCommand; … … 112 113 return; 113 114 } 114 final Command command = commandAndRelation.a;115 115 116 116 // to avoid EDT violations 117 117 SwingUtilities.invokeLater(() -> { 118 if (multipolygonRelation != null) {119 // rather ugly: update generated a ChangeMembersCommand with a copy of the member list, so clear the list now120 commandAndRelation.b.setMembers(null); // #see 19885121 }122 UndoRedoHandler.getInstance().add(command);118 UndoRedoHandler.getInstance().add(commandAndRelation.a); 119 Relation calculatedRel = commandAndRelation.b; 120 if (calculatedRel.getDataSet() == null) { 121 calculatedRel.setMembers(null); // see #19885 122 } 123 123 final Relation relation = (Relation) MainApplication.getLayerManager().getEditDataSet() 124 .getPrimitiveById(c ommandAndRelation.b);124 .getPrimitiveById(calculatedRel); 125 125 if (relation == null || relation.getDataSet() == null) 126 126 return; // should not happen … … 350 350 } else { 351 351 if (!unchanged) { 352 list.add(new ChangeMembersCommand(existingRelation, new ArrayList<>(relation.getMembers()))); 352 if (relation.getKeys().equals(existingRelation.getKeys())) 353 list.add(new ChangeMembersCommand(existingRelation, new ArrayList<>(relation.getMembers()))); 354 else 355 list.add(new ChangeCommand(existingRelation, relation)); 353 356 } 354 357 if (list.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.