Changeset 1780 in josm for trunk/src/org


Ignore:
Timestamp:
2009-07-13T14:41:19+02:00 (15 years ago)
Author:
stoecker
Message:

fix #2935 - selected relation wrong

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r1778 r1780  
    127127
    128128    public void updateList() {
     129        Relation selected = getSelected();
    129130        list.setSize(Main.ds.relations.size());
    130131        int i = 0;
     
    141142            setTitle(tr("Relations"), false);
    142143        }
     144        selectRelation(selected);
    143145    }
    144146
     
    214216     */
    215217    public void selectRelation(Relation relation) {
    216         if (relation == null) return;
     218        if (relation == null)
     219        {
     220            displaylist.clearSelection();
     221            return;
     222        }
    217223        int i = -1;
    218224        for (i=0; i < list.getSize(); i++) {
     
    224230        if (i >= 0 && i < list.getSize()) {
    225231            displaylist.setSelectedIndex(i);
     232            displaylist.ensureIndexIsVisible(i);
     233        }
     234        else
     235        {
     236            displaylist.clearSelection();
    226237        }
    227238    }
Note: See TracChangeset for help on using the changeset viewer.