Changeset 12005 in josm for trunk/src/org


Ignore:
Timestamp:
2017-04-26T01:13:37+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #14667 - IOOBE at PreferenceTabbedPane.stateChanged

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r11746 r12005  
    462462    }
    463463
    464     private void insertGUITabsForSetting(Icon icon, TabPreferenceSetting tps, int index) {
     464    private int insertGUITabsForSetting(Icon icon, TabPreferenceSetting tps, int index) {
    465465        int position = index;
    466466        for (PreferenceTab tab : tabs) {
     
    469469            }
    470470        }
     471        return position - 1;
    471472    }
    472473
     
    595596                    Icon icon = getIconAt(index);
    596597                    remove(index);
    597                     insertGUITabsForSetting(icon, preferenceSettings, index);
    598                     setSelectedIndex(index);
     598                    if (index <= insertGUITabsForSetting(icon, preferenceSettings, index)) {
     599                        setSelectedIndex(index);
     600                    }
    599601                } catch (SecurityException ex) {
    600602                    Main.error(ex);
Note: See TracChangeset for help on using the changeset viewer.