Changeset 1614 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-05-23T21:54:50+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/corrector
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r1613 r1614 112 112 113 113 for (Relation relation : Main.ds.relations) { 114 int position = 0; 114 115 for (RelationMember member : relation.members) { 115 116 if (!member.member.realEqual(oldway, true) 116 || member.role.length() == 0) 117 || member.role.length() == 0) { 118 position++; 117 119 continue; 120 } 118 121 119 122 boolean found = false; … … 129 132 if (found) 130 133 roleCorrectionMap.get(way).add( 131 new RoleCorrection(relation, member, newRole)); 134 new RoleCorrection(relation, position, member, newRole)); 135 136 position++; 132 137 } 133 138 } -
trunk/src/org/openstreetmap/josm/corrector/RoleCorrection.java
r1001 r1614 8 8 9 9 public final Relation relation; 10 public final int position; 10 11 public final RelationMember member; 11 12 public final String newRole; 12 13 13 public RoleCorrection(Relation relation, RelationMember member,14 String newRole) {14 public RoleCorrection(Relation relation, int position, 15 RelationMember member, String newRole) { 15 16 this.relation = relation; 17 this.position = position; 16 18 this.member = member; 17 19 this.newRole = newRole; -
trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java
r1613 r1614 168 168 List<RoleCorrection> roleCorrections = roleCorrectionMap 169 169 .get(primitive); 170 for (int i = 0; i < roleCorrections.size(); i++) { 171 if (roleTableMap.get(primitive) 172 .getCorrectionTableModel().getApply(i)) { 173 RoleCorrection roleCorrection = roleCorrections 174 .get(i); 175 Relation newRelation = new Relation( 176 roleCorrection.relation); 177 for (RelationMember member : newRelation.members) 178 if (member.equals(roleCorrection.member)) 170 for (Relation relation : Main.ds.relations) { 171 Relation newRelation = new Relation(relation); 172 Boolean changed = false; 173 174 for (int i = 0; i < roleCorrections.size(); i++) { 175 RoleCorrection roleCorrection = roleCorrections.get(i); 176 if (roleCorrection.relation == relation && 177 roleTableMap.get(primitive).getCorrectionTableModel().getApply(i)) { 178 179 RelationMember member = newRelation.members.get(roleCorrection.position); 180 181 if (member.equals(roleCorrection.member)) { 179 182 member.role = roleCorrection.newRole; 180 commands.add(new ChangeCommand( 181 roleCorrection.relation, newRelation)); 183 changed = true; 184 } 185 } 182 186 } 187 if (changed) 188 commands.add(new ChangeCommand(relation, newRelation)); 183 189 } 184 190 }
Note:
See TracChangeset
for help on using the changeset viewer.