Changeset 6886 in josm for trunk/src/org/openstreetmap/josm/command
- Timestamp:
- 2014-02-26T23:33:44+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java
r6881 r6886 5 5 6 6 import java.util.Collection; 7 import java.util.Set; 7 8 8 9 import javax.swing.Icon; … … 11 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 13 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer;14 14 import org.openstreetmap.josm.tools.ImageProvider; 15 15 16 16 /** 17 17 * Represents the resolution of a conflict between the deleted flag of two {@link OsmPrimitive}s. 18 * 18 * @since 1654 19 19 */ 20 20 public class DeletedStateConflictResolveCommand extends ConflictResolveCommand { … … 27 27 28 28 /** 29 * constructor29 * Constructs a new {@code DeletedStateConflictResolveCommand}. 30 30 * 31 31 * @param conflict the conflict data set … … 49 49 @Override 50 50 public boolean executeCommand() { 51 // remember the current state of modified primitives, i.e. of 52 // OSM primitive 'my' 53 // 51 // remember the current state of modified primitives, i.e. of OSM primitive 'my' 54 52 super.executeCommand(); 55 56 OsmDataLayer layer = getLayer();57 53 58 54 if (decision.equals(MergeDecisionType.KEEP_MINE)) { … … 60 56 // because my was involved in a conflict it my still be referred 61 57 // to from a way or a relation. Fix this now. 62 // 63 layer.data.unlinkReferencesToPrimitive(conflict.getMy()); 64 conflict.getMy().setDeleted(true); 58 deleteMy(); 65 59 } 66 60 } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) { 67 61 if (conflict.getTheir().isDeleted()) { 68 layer.data.unlinkReferencesToPrimitive(conflict.getMy()); 69 conflict.getMy().setDeleted(true); 62 deleteMy(); 70 63 } else { 71 64 conflict.getMy().setDeleted(false); … … 78 71 return true; 79 72 } 73 74 private void deleteMy() { 75 Set<OsmPrimitive> referrers = getLayer().data.unlinkReferencesToPrimitive(conflict.getMy()); 76 for (OsmPrimitive p : referrers) { 77 if (!p.isNew() && !p.isDeleted()) { 78 p.setModified(true); 79 } 80 } 81 conflict.getMy().setDeleted(true); 82 } 80 83 81 84 @Override
Note: See TracChangeset
for help on using the changeset viewer.