X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_mboxinset.C;h=c3f090db000e8d73283536517af0225100c483c9;hb=12ac7f339e14c4f76a24f45a21c0697303099145;hp=11ed0a796881e66bbbdcefe1a4212a66425da57e;hpb=6f851a34d2be0287fa356626fa4ec9d2724014f7;p=lyx.git diff --git a/src/mathed/math_mboxinset.C b/src/mathed/math_mboxinset.C index 11ed0a7968..c3f090db00 100644 --- a/src/mathed/math_mboxinset.C +++ b/src/mathed/math_mboxinset.C @@ -17,9 +17,11 @@ #include "BufferView.h" #include "buffer.h" #include "bufferparams.h" +#include "cursor.h" #include "debug.h" #include "metricsinfo.h" #include "output_latex.h" +#include "outputparams.h" #include "paragraph.h" #include "texrow.h" @@ -59,11 +61,21 @@ void MathMBoxInset::draw(PainterInfo & pi, int x, int y) const } -void MathMBoxInset::write(WriteStream & os) const +void MathMBoxInset::write(WriteStream & ws) const { - os << "\\mbox{\n"; - text_.write(*bv_->buffer(), os.os()); - os << "}"; + if (ws.latex()) { + ws << "\\mbox{\n"; + TexRow texrow; + OutputParams runparams; + latexParagraphs(*bv_->buffer(), text_.paragraphs(), + ws.os(), texrow, runparams); + ws.addlines(texrow.rows()); + ws << "}"; + } else { + ws << "\\mbox{\n"; + text_.write(*bv_->buffer(), ws.os()); + ws << "}"; + } } @@ -90,8 +102,8 @@ LyXText * MathMBoxInset::getText(int) const } -void MathMBoxInset::getCursorPos(CursorSlice const & cur, int & x, int & y) const +void MathMBoxInset::getCursorPos(LCursor const & cur, int & x, int & y) const { - x = text_.cursorX(cur); - y = text_.cursorY(cur); + x = text_.cursorX(cur.top()); + y = text_.cursorY(cur.top()); }