X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finseturl.C;h=4bd7f5765a8d581e512c828af431d7aafdd426ab;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=564e61a3aba189827692463cebae4dc4db024aeb;hpb=0d449056ef9ace3ef737e4b9aba8d3994615dc18;p=lyx.git diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index 564e61a3ab..4bd7f5765a 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -22,9 +22,10 @@ #include "support/std_ostream.h" -using lyx::docstring; -using lyx::odocstream; -using lyx::support::subst; + +namespace lyx { + +using support::subst; using std::string; using std::ostream; @@ -40,20 +41,19 @@ docstring const InsetUrl::getScreenLabel(Buffer const &) const docstring const temp = (getCmdName() == "url") ? _("Url: ") : _("HtmlUrl: "); - string url; + docstring url; - if (!getOptions().empty()) - url += getOptions(); + if (!getParam("name").empty()) + url += getParam("name"); else - url += getContents(); + url += getParam("target"); // elide if long if (url.length() > 30) { url = url.substr(0, 10) + "..." + url.substr(url.length() - 17, url.length()); } - // FIXME UNICODE - return temp + lyx::from_utf8(url); + return temp + url; } @@ -73,13 +73,11 @@ int InsetUrl::latex(Buffer const &, odocstream & os, int InsetUrl::plaintext(Buffer const &, odocstream & os, OutputParams const &) const { - // FIXME UNICODE - os << '[' << lyx::from_utf8(getContents()); - if (getOptions().empty()) + os << '[' << getParam("target"); + if (getParam("name").empty()) os << ']'; else - // FIXME UNICODE - os << "||" << lyx::from_utf8(getOptions()) << ']'; + os << "||" << getParam("name") << ']'; return 0; } @@ -87,12 +85,11 @@ int InsetUrl::plaintext(Buffer const &, odocstream & os, int InsetUrl::docbook(Buffer const &, odocstream & os, OutputParams const &) const { - // FIXME UNICODE - os << "" - << lyx::from_ascii(getOptions()) - << ""; + os << "" + << getParam("name") + << ""; return 0; } @@ -108,3 +105,6 @@ void InsetUrl::validate(LaTeXFeatures & features) const { features.require("url"); } + + +} // namespace lyx