]> git.lyx.org Git - features.git/blobdiff - src/insets/inseturl.C
change to use only ostream to write latex from insets
[features.git] / src / insets / inseturl.C
index af469908377cd70c9deaff0e6f2ce20d089569c6..9416d82660695e8b8fc3b8f3a86d43bfaa57021d 100644 (file)
@@ -168,14 +168,24 @@ string InsetUrl::getScreenLabel() const
 
 int InsetUrl::Latex(ostream & os, signed char fragile) 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
 {
        if (!getOptions().empty())
@@ -187,6 +197,7 @@ int InsetUrl::Latex(string & file, signed char fragile) const
 
        return 0;
 }
+#endif
 
 
 int InsetUrl::Linuxdoc(string & file) const