]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetFormulaMacro.cpp
XHTML output was a mess for grids output as LaTeX. This will probably
[lyx.git] / src / mathed / InsetFormulaMacro.cpp
index d3c4183ce654e471f828fbf0f27e224a77d9a182..eaa89d70e3087715204e36eef74f1541b4686012 100644 (file)
@@ -4,7 +4,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -17,8 +17,8 @@
 
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 
 
 #include <sstream>
 
-using std::string;
-using std::ostream;
-using std::endl;
+using namespace std;
+using namespace lyx::support;
 
 namespace lyx {
 
-using support::bformat;
-
 
 InsetFormulaMacro::InsetFormulaMacro()
-       : InsetMathNest(2), name_("unknownA")
+       : InsetMathNest(2), name_(from_ascii("unknownA"))
 {}
 
 
@@ -54,7 +51,7 @@ InsetFormulaMacro::InsetFormulaMacro
 InsetFormulaMacro::InsetFormulaMacro(string const & s)
        : InsetMathNest(2), name_("unknownB")
 {
-       std::istringstream is(s);
+       istringstream is(s);
        read(is);
 }
 
@@ -65,29 +62,30 @@ Inset * InsetFormulaMacro::clone() const
 }
 
 
-void InsetFormulaMacro::write(Buffer const &, ostream & os) const
+void InsetFormulaMacro::write(ostream & os) const
 {
        os << "FormulaMacro\n";
-       WriteStream wi(os, false, false);
+       WriteStream wi(os, false, false, WriteStream::wsDefault);
        tmpl()->write(wi);
 }
 
 
-int InsetFormulaMacro::latex(Buffer const &, odocstream & os,
+int InsetFormulaMacro::latex(odocstream & os,
                             OutputParams const & runparams) const
 {
        //lyxerr << "InsetFormulaMacro::latex" << endl;
-       WriteStream wi(os, runparams.moving_arg, true);
+       WriteStream wi(os, runparams.moving_arg, true,
+                      runparams.dryrun ? WriteStream::wsDryrun: WriteStream::wsDefault,
+                      runparams.encoding);
        tmpl()->write(wi);
        return 2;
 }
 
 
-int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
-                                OutputParams const &) const
+int InsetFormulaMacro::plaintext(odocstream & os, OutputParams const & runparams) const
 {
        odocstringstream oss;
-       WriteStream wi(oss, false, true);
+       WriteStream wi(oss, false, true, WriteStream::wsDefault, runparams.encoding);
        tmpl()->write(wi);
 
        docstring const str = oss.str();
@@ -96,20 +94,20 @@ int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os,
 }
 
 
-int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os,
+int InsetFormulaMacro::docbook(ostream & os,
                               OutputParams const & runparams) const
 {
-       return plaintext(buf, os, runparams);
+       return plaintext(os, runparams);
 }
 
 
-void InsetFormulaMacro::read(Buffer const &, Lexer & lex)
+void InsetFormulaMacro::read(Lexer & lex)
 {
        read(lex.getStream());
 }
 
 
-void InsetFormulaMacro::read(std::istream & is)
+void InsetFormulaMacro::read(istream & is)
 {
        auto_ptr<MathMacroTemplate> p(new MathMacroTemplate(is));
        name_ = p->name();