From e91aba8dd07c8f8fafefa21f1e2dd7b10e3ccae0 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 25 Aug 2002 01:15:01 +0000 Subject: [PATCH] elide long URLs - http://bugzilla.lyx.org/show_bug.cgi?id=404 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5096 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/inseturl.C | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) 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; }