Changeset 9465 in josm


Ignore:
Timestamp:
2016-01-15T15:59:13+01:00 (9 years ago)
Author:
simon04
Message:

fix #12160 - Combobox List Entries with Empty Value – display_value and short_description not shown

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

    r8863 r9465  
    3939            lhm.put(def, new PresetListEntry(def));
    4040        }
    41         lhm.put("", new PresetListEntry(""));
     41        if (!lhm.containsKey("")) {
     42            lhm.put("", new PresetListEntry(""));
     43        }
    4244
    4345        combo = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[0]));
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r9360 r9465  
    201201        public String getListDisplay() {
    202202            if (value.equals(DIFFERENT))
    203                 return "<b>"+DIFFERENT.replaceAll("<", "&lt;").replaceAll(">", "&gt;")+"</b>";
    204 
    205             if (value.isEmpty())
    206                 return "&nbsp;";
     203                return "<b>" + Utils.escapeReservedCharactersHTML(DIFFERENT) + "</b>";
    207204
    208205            final StringBuilder res = new StringBuilder("<b>");
    209             res.append(getDisplayValue(true).replaceAll("<", "&lt;").replaceAll(">", "&gt;"))
     206            res.append(Utils.escapeReservedCharactersHTML(getDisplayValue(true)))
    210207               .append("</b>");
    211208            if (getShortDescription(true) != null) {
Note: See TracChangeset for help on using the changeset viewer.