Ignore:
Timestamp:
2010-02-23T08:58:12+01:00 (16 years ago)
Author:
jttt
Message:

Fix #4467 Don't silently drop locally deleted member primitives from downloaded ways and relation (fix the issue when deleted primitive is referenced)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java

    r2945 r3034  
    2323
    2424    /** the conflict to resolve */
    25     private Conflict<OsmPrimitive> conflict;
     25    private Conflict<? extends OsmPrimitive> conflict;
    2626
    2727    /** the merge decision */
     
    3535     * @param decision the merge decision
    3636     */
    37     public DeletedStateConflictResolveCommand(OsmPrimitive my, OsmPrimitive their, MergeDecisionType decision) {
    38         this.conflict = new Conflict<OsmPrimitive>(my, their);
     37    public DeletedStateConflictResolveCommand(Conflict<? extends OsmPrimitive> conflict, MergeDecisionType decision) {
     38        this.conflict = conflict;
    3939        this.decision = decision;
    4040    }
     
    6161
    6262        if (decision.equals(MergeDecisionType.KEEP_MINE)) {
    63             if (conflict.getMy().isDeleted()) {
     63            if (conflict.getMy().isDeleted() || conflict.isMyDeleted()) {
    6464                // because my was involved in a conflict it my still be referred
    6565                // to from a way or a relation. Fix this now.
    6666                //
    6767                layer.data.unlinkReferencesToPrimitive(conflict.getMy());
     68                conflict.getMy().setDeleted(true);
    6869            }
    6970        } else if (decision.equals(MergeDecisionType.KEEP_THEIR)) {
     
    8687            Collection<OsmPrimitive> added) {
    8788        modified.add(conflict.getMy());
     89        modified.addAll(conflict.getMy().getReferrers());
    8890    }
    8991}
Note: See TracChangeset for help on using the changeset viewer.