]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_mboxinset.C
Remove mixed_content from output parameters.
[lyx.git] / src / mathed / math_mboxinset.C
index 11ed0a796881e66bbbdcefe1a4212a66425da57e..c3f090db000e8d73283536517af0225100c483c9 100644 (file)
 #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());
 }