]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMBox.C
cursor is no more damaging the background. L-shaped cursor is broken right now....
[lyx.git] / src / mathed / InsetMathMBox.C
index 970ffc4a0667f1600c63c3687eac1121c1f9ee97..962ece1de04e3cde30d299ac38585b2d5c9f4d3e 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "InsetMathMBox.h"
 #include "MathData.h"
-#include "MathMLStream.h"
 
 #include "BufferView.h"
 #include "buffer.h"
 #include "paragraph.h"
 #include "texrow.h"
 
+
+namespace lyx {
+
+using odocstream;
+
 using std::auto_ptr;
 using std::endl;
 
@@ -73,13 +77,15 @@ void InsetMathMBox::write(WriteStream & ws) const
                ws << "}";
        } else {
                ws << "\\mbox{\n";
-               text_.write(*bv_->buffer(), ws.os());
+               std::ostringstream os;
+               text_.write(*bv_->buffer(), os);
+               ws.os() << from_utf8(os.str());
                ws << "}";
        }
 }
 
 
-int InsetMathMBox::latex(Buffer const & buf, std::ostream & os,
+int InsetMathMBox::latex(Buffer const & buf, odocstream & os,
                        OutputParams const & runparams) const
 {
        os << "\\mbox{\n";
@@ -102,8 +108,8 @@ LyXText * InsetMathMBox::getText(int) const
 }
 
 
-void InsetMathMBox::cursorPos
-       (CursorSlice const & sl, bool boundary, int & x, int & y) const
+void InsetMathMBox::cursorPos(BufferView const & bv,
+               CursorSlice const & sl, bool boundary, int & x, int & y) const
 {
        x = text_.cursorX(sl, boundary);
        y = text_.cursorY(sl, boundary);
@@ -114,3 +120,6 @@ void InsetMathMBox::drawSelection(PainterInfo & pi, int x, int y) const
 {
        text_.drawSelection(pi, x, y);
 }
+
+
+} // namespace lyx