]> git.lyx.org Git - features.git/commitdiff
elide long URLs - http://bugzilla.lyx.org/show_bug.cgi?id=404
authorJohn Levon <levon@movementarian.org>
Sun, 25 Aug 2002 01:15:01 +0000 (01:15 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 25 Aug 2002 01:15:01 +0000 (01:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5096 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/inseturl.C

index 98f1255173a92d1f7b792cfa81a3af3b18eb8af9..0456a04c760c06447ef1a7f4f08dfe604089ca9b 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-25  John Levon  <levon@movementarian.org>
+
+       * inseturl.C: elide long URLs (bug 404)
 2002-08-23  Rob Lahaye  <lahaye@snu.ac.kr>
 
        * insetgraphics.[Ch]: remove InsetGraphics::readFigInset()
index 731147c73ad0b085202ce4249379749f47ae84a5..d73ccd377b2015334c4670382bd1f8b8b4af0a61 100644 (file)
@@ -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();
-
-       return temp;
+               url += getContents();
+
+       // elide if long
+       if (url.length() > 30) {
+               url = url.substr(0, 10) + "..."
+                       + url.substr(url.length() - 17, url.length());
+       }
+       return temp + url;
 }