Changeset 17375 in josm for trunk/src


Ignore:
Timestamp:
2020-11-29T10:57:33+01:00 (3 years ago)
Author:
GerdP
Message:

fix #20163: Split way corrupts relation when splitting via way

  • if via way in turn restriction is split we have to insert new member
File:
1 edited

Legend:

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

    r17367 r17375  
    467467                        if (rValue.warnme) warnings.add(WarningType.GENERIC);
    468468                        insert = rValue.insert;
    469                         c = rValue.relation;
     469                        c = rValue.relation; // Value.relation is null or contains a modified copy
    470470                    } else if (!isOrderedRelation) {
    471471                        // Warn the user when relations that are not a route or multipolygon are modified as a result
     
    473473                        warnings.add(WarningType.GENERIC);
    474474                    }
    475                     if (c == null) {
    476                         c = new Relation(r);
    477                     }
    478475
    479476                    if (insert) {
     477                        if (c == null) {
     478                            c = new Relation(r);
     479                        }
    480480                        if (rm.hasRole() && !nowarnroles.contains(rm.getRole())) {
    481481                            warnings.add(WarningType.ROLE);
     
    818818                    c.addMember(new RelationMember(role, res));
    819819                    c.removeMembersFor(way);
    820                     relationInformation.insert = false;
    821820                }
    822             } else {
    823                 relationInformation.insert = false;
    824821            }
    825822        } else if (!"via".equals(role)) {
    826823            relationInformation.warnme = true;
     824        } else {
     825            relationInformation.insert = true;
    827826        }
    828827        relationInformation.relation = c;
Note: See TracChangeset for help on using the changeset viewer.