Changeset 9496 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
- Timestamp:
- 2016-01-17T02:54:22+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r9388 r9496 703 703 * Sort the selected relation members by the way they are linked. 704 704 */ 705 void sort() {705 public void sort() { 706 706 List<RelationMember> selectedMembers = new ArrayList<>(getSelectedMembers()); 707 List<RelationMember> sortedMembers = null;707 List<RelationMember> sortedMembers; 708 708 List<RelationMember> newMembers; 709 709 if (selectedMembers.size() <= 1) { … … 727 727 } 728 728 729 if (members.size() != newMembers.size()) throw new AssertionError(); 729 if (members.size() != newMembers.size()) 730 throw new AssertionError(); 730 731 731 732 members.clear(); … … 738 739 * Sort the selected relation members and all members below by the way they are linked. 739 740 */ 740 void sortBelow() {741 final List<RelationMember> subList = members.subList( getSelectionModel().getMinSelectionIndex(), members.size());741 public void sortBelow() { 742 final List<RelationMember> subList = members.subList(Math.max(0, getSelectionModel().getMinSelectionIndex()), members.size()); 742 743 final List<RelationMember> sorted = relationSorter.sortMembers(subList); 743 744 subList.clear(); … … 766 767 * Reverse the relation members. 767 768 */ 768 void reverse() {769 public void reverse() { 769 770 List<Integer> selectedIndices = getSelectedIndices(); 770 771 List<Integer> selectedIndicesReversed = getSelectedIndices();
Note:
See TracChangeset
for help on using the changeset viewer.