X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finseturl.C;h=ae2c16a9fe1028ce8dfef62db6b4a6dfe2470875;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=9416d82660695e8b8fc3b8f3a86d43bfaa57021d;hpb=a9b448a027036c65c40b372bd19e02f243d1f1ab;p=lyx.git
diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C
index 9416d82660..ae2c16a9fe 100644
--- a/src/insets/inseturl.C
+++ b/src/insets/inseturl.C
@@ -14,6 +14,7 @@
#include "LaTeXFeatures.h"
#include "lyx_gui_misc.h" // CancelCloseBoxCB
+using std::ostream;
InsetUrl::InsetUrl(string const & cmd)
: fd_form_url(0)
@@ -109,6 +110,12 @@ extern "C" void C_InsetUrl_CloseUrlCB(FL_OBJECT * ob, long data)
}
+char const * InsetUrl::EditMessage() const
+{
+ return _("Opened Url");
+}
+
+
void InsetUrl::Edit(BufferView * bv, int, int, unsigned int)
{
static int ow = -1, oh;
@@ -166,55 +173,42 @@ string InsetUrl::getScreenLabel() const
}
-int InsetUrl::Latex(ostream & os, signed char fragile) const
+int InsetUrl::Latex(ostream & os,
+ bool fragile, bool /*free_spc*/) const
{
-#ifdef USE_OSTREAM_ONLY
if (!getOptions().empty())
os << getOptions() + ' ';
if (fragile)
os << "\\protect";
os << "\\url{" << getContents() << '}';
return 0;
-#else
- string latex_output;
- int res = Latex(latex_output, fragile);
- os << latex_output;
-
- return res;
-#endif
}
-#ifndef USE_OSTREAM_ONLY
-int InsetUrl::Latex(string & file, signed char fragile) const
+int InsetUrl::Ascii(ostream & os) const
{
- if (!getOptions().empty())
- file += getOptions() + ' ';
- if (fragile)
- file += "\\protect";
-
- file += "\\url{" + getContents() + '}';
-
+ if (getOptions().empty())
+ os << "[" << getContents() << "]";
+ else
+ os << "[" << getContents() << "||" << getOptions() << "]";
return 0;
}
-#endif
-int InsetUrl::Linuxdoc(string & file) const
+int InsetUrl::Linuxdoc(ostream & os) const
{
- file += "<"+ getCmdName() +
- " url=\"" + getContents()+"\"" +
- " name=\"" + getOptions() +"\">";
+ os << "<" << getCmdName()
+ << " url=\"" << getContents() << "\""
+ << " name=\"" << getOptions() << "\">";
return 0;
}
-int InsetUrl::DocBook(string & file) const
+int InsetUrl::DocBook(ostream & os) const
{
- file += "" +
- getOptions() +"";
-
+ os << ""
+ << getOptions() << "";
return 0;
}