X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathMBox.cpp;h=8b38755f0485eb9d98ecc698596837d64fdd7019;hb=704328d3488c75733ddeb9ad5439b1907e323e39;hp=f7d7d1b07c3677380e08d6b729801b73bd463404;hpb=e8674d6141a5611aff74b1865b5d17549d101545;p=lyx.git diff --git a/src/mathed/InsetMathMBox.cpp b/src/mathed/InsetMathMBox.cpp index f7d7d1b07c..8b38755f04 100644 --- a/src/mathed/InsetMathMBox.cpp +++ b/src/mathed/InsetMathMBox.cpp @@ -32,15 +32,15 @@ using namespace std; namespace lyx { -InsetMathMBox::InsetMathMBox(Buffer const & buffer) : text_(buffer) +InsetMathMBox::InsetMathMBox(Buffer * buffer) : InsetMath(buffer), text_(buffer) { text_.paragraphs().clear(); text_.paragraphs().push_back(Paragraph()); } -InsetMathMBox::InsetMathMBox(Buffer const & buffer, Layout const & layout) - : text_(buffer) +InsetMathMBox::InsetMathMBox(Buffer * buffer, Layout const & layout) + : InsetMath(buffer), text_(buffer) { text_.paragraphs().clear(); text_.paragraphs().push_back(Paragraph()); @@ -75,26 +75,25 @@ void InsetMathMBox::write(WriteStream & ws) const ws << "\\mbox{\n"; TexRow texrow; OutputParams runparams(&buffer().params().encoding()); - latexParagraphs(buffer(), text_.text(), ws.os(), texrow, runparams); + otexstream os(ws.os(), texrow); + latexParagraphs(buffer(), text_.text(), os, runparams); ws.addlines(texrow.rows()); ws << "}"; } else { ws << "\\mbox{\n"; ostringstream os; - text_.text().write(buffer(), os); + text_.text().write(os); ws.os() << from_utf8(os.str()); ws << "}"; } } -int InsetMathMBox::latex(odocstream & os, OutputParams const & runparams) const +void InsetMathMBox::latex(otexstream & os, OutputParams const & runparams) const { os << "\\mbox{\n"; - TexRow texrow; - latexParagraphs(buffer(), text_.text(), os, texrow, runparams); + latexParagraphs(buffer(), text_.text(), os, runparams); os << "}"; - return texrow.rows(); } @@ -118,4 +117,16 @@ void InsetMathMBox::cursorPos(BufferView const & bv, } +void InsetMathMBox::mathmlize(MathStream & ms) const +{ + SetMode textmode(ms, true); + ms << cell(0); +} + +void InsetMathMBox::htmlize(HtmlStream & ms) const +{ + SetHTMLMode textmode(ms, true); + ms << cell(0); +} + } // namespace lyx