Ticket #2172: reversemember.patch

File reversemember.patch, 2.8 KB (added by Teemu Koskinen <teemu.koskinen@…>, 15 years ago)
  • src/org/openstreetmap/josm/actions/ReverseWayAction.java

     
    6666            if (Main.pref.getBoolean("tag-correction.reverse-way", true)) {
    6767                try
    6868                {
    69                     final Collection<Command> changePropertyCommands = reverseWayTagCorrector.execute(wnew);
     69                    final Collection<Command> changePropertyCommands = reverseWayTagCorrector.execute(w, wnew);
    7070                    propertiesUpdated = propertiesUpdated
    7171                        || (changePropertyCommands != null && !changePropertyCommands.isEmpty());
    7272                    c.addAll(changePropertyCommands);
  • src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

     
    3434            this.a = a;
    3535            this.b = b;
    3636            startPattern = Pattern.compile(
    37                     "^(" + a + "|" + b + ")" + SEPARATOR,
     37                    "^(" + a + "|" + b + ")(" + SEPARATOR + "|$)",
    3838                    Pattern.CASE_INSENSITIVE);
    3939            endPattern = Pattern.compile(
    4040                    SEPARATOR + "(" + a + "|" + b + ")$",
     
    6767            };
    6868
    6969    @Override
    70     public Collection<Command> execute(Way way) throws UserCancelException {
     70    public Collection<Command> execute(Way oldway, Way way) throws UserCancelException {
    7171        Map<OsmPrimitive, List<TagCorrection>> tagCorrectionsMap =
    7272                new HashMap<OsmPrimitive, List<TagCorrection>>();
    7373
     
    112112
    113113        for (Relation relation : Main.ds.relations) {
    114114            for (RelationMember member : relation.members) {
    115                 if (!member.member.realEqual(way, true)
     115                if (!member.member.realEqual(oldway, true)
    116116                        || member.role.length() == 0)
    117117                    continue;
    118118
  • src/org/openstreetmap/josm/corrector/TagCorrector.java

     
    3232
    3333public abstract class TagCorrector<P extends OsmPrimitive> {
    3434
    35     public abstract Collection<Command> execute(P primitive)
     35    public abstract Collection<Command> execute(P primitive, P oldprimitive)
    3636        throws UserCancelException;
    3737
    3838    private String[] applicationOptions = new String[] {