Changeset 18781 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2023-07-26T17:49:17+02:00 (12 months ago)
Author:
taylor.smock
Message:

Fix #23023: Fix logic for enabling buttons in color preferences (patch by Larsossum)

This makes the buttons work properly with the filterfield.

File:
1 edited

Legend:

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

    r17865 r18781  
    442442    private void updateEnabledState() {
    443443        int sel = colors.getSelectedRow();
    444         if (sel < 0 || sel >= colors.getRowCount()) {
    445             return;
    446         }
    447         ColorEntry ce = (ColorEntry) colors.getValueAt(sel, 0);
     444        ColorEntry ce;
     445        if (sel >= 0 && sel < colors.getRowCount()) {
     446            ce = (ColorEntry) colors.getValueAt(sel, 0);
     447        } else {
     448            ce = null;
     449        }
    448450        remove.setEnabled(ce != null && isRemoveColor(ce));
    449451        colorEdit.setEnabled(ce != null);
Note: See TracChangeset for help on using the changeset viewer.