Changeset 16687 in josm


Ignore:
Timestamp:
2020-06-21T09:54:46+02:00 (4 years ago)
Author:
simon04
Message:

fix #16031 - Presets: make use_last_as_default="true" work (patch by mikko.lukas)

Location:
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java

    r16565 r16687  
    9595            // all items were unset (and so is default)
    9696            originalValue = getListEntry("");
    97             if (!presetInitiallyMatches && isForceUseLastAsDefault() && LAST_VALUES.containsKey(key)) {
     97            if (!presetInitiallyMatches && isUseLastAsDefault() && LAST_VALUES.containsKey(key)) {
    9898                combobox.setSelectedItem(getListEntry(LAST_VALUES.get(key)));
    9999            } else {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelect.java

    r16057 r16687  
    3939        } else if (usage.unused()) {
    4040            originalValue = null;
    41             list.setSelectedItem(originalValue);
     41            if (!presetInitiallyMatches && isUseLastAsDefault() && LAST_VALUES.containsKey(key)) {
     42                list.setSelectedItem(getListEntry(LAST_VALUES.get(key)));
     43            } else {
     44                list.setSelectedItem(originalValue);
     45            }
    4246        } else {
    4347            originalValue = DIFFERENT;
Note: See TracChangeset for help on using the changeset viewer.