Ticket #2305: preset_link.patch

File preset_link.patch, 978 bytes (added by jttt, 17 years ago)
  • src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

     
    381381        @Override public void addToPanel(JPanel p, Collection<OsmPrimitive> sel) {
    382382            if(locale_text == null)
    383383                locale_text = text == null ? tr("More information about this feature") : tr(text);
    384             p.add(new UrlLabel(locale_href, locale_text), GBC.eol().anchor(GBC.WEST));
     384            String url = locale_href;
     385            if (url == null) {
     386                url = href;
     387            }
     388            if (url != null) {
     389                p.add(new UrlLabel(url, locale_text), GBC.eol().anchor(GBC.WEST));
     390            }
    385391        }
    386392        @Override public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) {}
    387393    }