Changeset 2944 in josm


Ignore:
Timestamp:
2010-02-06T09:33:38+01:00 (10 years ago)
Author:
jttt
Message:

Fix unlinking primitive from relation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r2871 r2944  
    700700    public void unlinkPrimitiveFromRelations(OsmPrimitive primitive) {
    701701        for (Relation relation : relations) {
    702             Iterator<RelationMember> it = relation.getMembers().iterator();
     702            List<RelationMember> members = relation.getMembers();
     703
     704            Iterator<RelationMember> it = members.iterator();
     705            boolean removed = false;
    703706            while(it.hasNext()) {
    704707                RelationMember member = it.next();
    705708                if (member.getMember().equals(primitive)) {
    706709                    it.remove();
     710                    removed = true;
    707711                }
     712            }
     713
     714            if (removed) {
     715                relation.setMembers(members);
    708716            }
    709717        }
Note: See TracChangeset for help on using the changeset viewer.