Changeset 12942 in josm


Ignore:
Timestamp:
2017-10-08T13:39:18+02:00 (2 months ago)
Author:
bastiK
Message:

see #15410 - better fix for color name display

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r12894 r12942  
    986986            return tr("Layer: {0}", tr(I18n.escape(m.group(1))));
    987987        }
    988         return tr(I18n.escape(colornames.containsKey(o) ? colornames.get(o) : o));
     988        String fullKey = COLOR_PREFIX + o;
     989        return tr(I18n.escape(colornames.containsKey(fullKey) ? colornames.get(fullKey) : fullKey));
    989990    }
    990991
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r12929 r12942  
    145145
    146146    private static String getName(String o) {
    147         return Main.pref.getColorName("color." + o);
     147        return Main.pref.getColorName(o);
    148148    }
    149149
  • trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java

    r11543 r12942  
    3232    @Test
    3333    public void testColorName() {
    34         assertEquals("color.layer {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx",
    35                 Main.pref.getColorName("color.layer {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx"));
     34        assertEquals("Layer: {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx",
     35                Main.pref.getColorName("layer {5DE308C0-916F-4B5A-B3DB-D45E17F30172}.gpx"));
    3636    }
    3737
Note: See TracChangeset for help on using the changeset viewer.