]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetHyperlink.cpp
When selecting special logos, set their color correctly
[lyx.git] / src / insets / InsetHyperlink.cpp
index 60c64f9421c66fc955684052576e754bd8d8b7fa..8b3433c944b0b105afb84800cc1245b470df561e 100644 (file)
@@ -22,6 +22,7 @@
 #include "LaTeXFeatures.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
+#include "texstream.h"
 
 #include "support/docstream.h"
 #include "support/FileName.h"
@@ -56,7 +57,7 @@ ParamInfo const & InsetHyperlink::findInfo(string const & /* cmdName */)
 
 docstring InsetHyperlink::screenLabel() const
 {
-       docstring const temp = from_ascii("Hyperlink: ");
+       docstring const temp = _("Hyperlink: ");
 
        docstring url;
 
@@ -66,8 +67,9 @@ docstring InsetHyperlink::screenLabel() const
 
        // elide if long
        if (url.length() > 30) {
-               url = url.substr(0, 10) + "..."
-                       + url.substr(url.length() - 17, url.length());
+               docstring end = url.substr(url.length() - 17, url.length());
+               support::truncateWithEllipsis(url, 13);
+               url += end;
        }
        return temp + url;
 }
@@ -191,7 +193,7 @@ void InsetHyperlink::latex(otexstream & os,
                pair<docstring, docstring> name_latexed =
                        runparams.encoding->latexString(name, runparams.dryrun);
                name = name_latexed.first;
-               if (!name_latexed.second.empty()) {
+               if (!name_latexed.second.empty() && !runparams.silent) {
                        // issue a warning about omitted characters
                        // FIXME: should be passed to the error dialog
                        frontend::Alert::warning(_("Uncodable characters"),
@@ -257,7 +259,7 @@ void InsetHyperlink::toString(odocstream & os) const
 }
 
 
-void InsetHyperlink::forToc(docstring & os, size_t) const
+void InsetHyperlink::forOutliner(docstring & os, size_t const, bool const) const
 {
        docstring const & n = getParam("name");
        if (!n.empty()) {