]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inseturl.C
Make it compile when USE_BOOST_FORMAT is unset
[lyx.git] / src / insets / inseturl.C
index 1fbad24d33c909fddfb51fcf5adf298ef75433d0..46678467dba6602376521dcffe0a0c411a6c6a96 100644 (file)
@@ -1,3 +1,12 @@
+/**
+ * \file inseturl.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author José Matos
+ *
+ * Full author contact details are available in file CREDITS
+ */
 #include <config.h>
 
 #ifdef __GNUG__
@@ -21,15 +30,15 @@ InsetUrl::InsetUrl(InsetCommandParams const & p, bool)
 {}
 
 
-void InsetUrl::edit(BufferView * bv, int, int, unsigned int)
+void InsetUrl::edit(BufferView * bv, int, int, mouse_button::state)
 {
-       bv->owner()->getDialogs()->showUrl(this);
+       bv->owner()->getDialogs().showUrl(this);
 }
 
 
 void InsetUrl::edit(BufferView * bv, bool)
 {
-       edit(bv, 0, 0, 0);
+       edit(bv, 0, 0, mouse_button::none);
 }
 
 
@@ -41,12 +50,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;
 }
 
 
@@ -82,7 +98,7 @@ int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetUrl::docbook(Buffer const *, ostream & os) const
+int InsetUrl::docbook(Buffer const *, ostream & os, bool) const
 {
        os << "<ulink url=\"" << subst(getContents(),"&","&amp;")
           << "\">" << getOptions() << "</ulink>";