diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 98f1255173..0456a04c76 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-08-25 John Levon + + * inseturl.C: elide long URLs (bug 404) + 2002-08-23 Rob Lahaye * insetgraphics.[Ch]: remove InsetGraphics::readFigInset() diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index 731147c73a..d73ccd377b 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -41,12 +41,19 @@ string const InsetUrl::getScreenLabel(Buffer const *) const else temp = _("HtmlUrl: "); + string url; + if (!getOptions().empty()) - temp += getOptions(); + url += getOptions(); else - temp += getContents(); + url += getContents(); - return temp; + // elide if long + if (url.length() > 30) { + url = url.substr(0, 10) + "..." + + url.substr(url.length() - 17, url.length()); + } + return temp + url; }