Ignore:
Timestamp:
2009-08-10T20:36:40+02:00 (10 years ago)
Author:
jttt
Message:

Replace some occurrences of RelationMember.member with getters

Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

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

    r1750 r1951  
    4040
    4141    /**
    42      * 
     42     *
    4343     * @param my my relation
    4444     * @param their their relation
     
    7272        // nodes
    7373        //
    74         my.members.clear();
    75         for (int i=0; i<mergedMembers.size();i++) {
    76             RelationMember n = mergedMembers.get(i);
    77             my.members.add(n);
    78         }
     74        my.setMembers(mergedMembers);
    7975
    8076        // remember the layer
    81         layer = Main.main.map.mapView.getEditLayer();
     77        layer = Main.map.mapView.getEditLayer();
    8278        return true;
    8379    }
  • trunk/src/org/openstreetmap/josm/command/RemoveRelationMemberCommand.java

    r1814 r1951  
    4444    @Override public boolean executeCommand() {
    4545        super.executeCommand();
    46         int removed_at = relation.members.indexOf(member);
    47         relation.members.remove(member);
    48         if ((location != -1) && (removed_at != location)) {
    49             relation.members.add(removed_at, member);
     46        int removeIndex = relation.getMembers().indexOf(member);
     47        if ((location != -1) && (removeIndex != location)) {
    5048            Main.debug("error removing relation member");
    5149            return false;
     50        } else {
     51            relation.removeMember(removeIndex);
     52            relation.modified = true;
     53            return true;
    5254        }
    53         relation.modified = true;
    54         return true;
    5555    }
    5656
    5757    @Override public void undoCommand() {
    5858        super.undoCommand();
    59         relation.members.add(member);
     59        relation.addMember(member);
    6060        relation.modified = this.getOrig(relation).modified;
    6161    }
Note: See TracChangeset for help on using the changeset viewer.