X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetFormulaMacro.cpp;h=88897021fe2bd63fa7fce8e95b8ecbb3d9ce77ee;hb=d243e53f54e861c90ce7135f3d1a8d68d6202555;hp=b38f2619ccdd5ab93b2d4b8a6c0bb3b131cde8f5;hpb=0e834b9342b582794c005ca309929142fc101f91;p=lyx.git diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index b38f2619cc..88897021fe 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -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. */ @@ -36,7 +36,7 @@ namespace lyx { InsetFormulaMacro::InsetFormulaMacro() - : InsetMathNest(2), name_("unknownA") + : InsetMathNest(2), name_(from_ascii("unknownA")) {} @@ -65,26 +65,29 @@ Inset * InsetFormulaMacro::clone() const void InsetFormulaMacro::write(ostream & os) const { os << "FormulaMacro\n"; - WriteStream wi(os, false, false, false); + WriteStream wi(os, false, false, WriteStream::wsDefault); tmpl()->write(wi); } -int InsetFormulaMacro::latex(odocstream & os, - OutputParams const & runparams) const +void InsetFormulaMacro::latex(otexstream & os, + OutputParams const & runparams) const { //lyxerr << "InsetFormulaMacro::latex" << endl; - WriteStream wi(os, runparams.moving_arg, true, runparams.dryrun, - runparams.encoding); + WriteStream wi(os.os(), runparams.moving_arg, true, + runparams.dryrun ? WriteStream::wsDryrun: WriteStream::wsDefault, + runparams.encoding); + wi.canBreakLine(os.canBreakLine()); tmpl()->write(wi); - return 2; + os.canBreakLine(wi.canBreakLine()); + os.texrow().newlines(wi.line()); } -int InsetFormulaMacro::plaintext(odocstream & os, OutputParams const & runparams) const +int InsetFormulaMacro::plaintext(odocstringstream & os, OutputParams const & runparams, size_t) const { odocstringstream oss; - WriteStream wi(oss, false, true, false, runparams.encoding); + WriteStream wi(oss, false, true, WriteStream::wsDefault, runparams.encoding); tmpl()->write(wi); docstring const str = oss.str();