]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathMBox.C
fix reading UTF8 encoded symbol file
[lyx.git] / src / mathed / InsetMathMBox.C
index 970ffc4a0667f1600c63c3687eac1121c1f9ee97..b4b16a11dd2c41386e092c3fbc8b603a06e06ac2 100644 (file)
 #include "paragraph.h"
 #include "texrow.h"
 
+
+namespace lyx {
+
+using odocstream;
+
 using std::auto_ptr;
 using std::endl;
 
@@ -73,13 +78,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 +109,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 +121,6 @@ void InsetMathMBox::drawSelection(PainterInfo & pi, int x, int y) const
 {
        text_.drawSelection(pi, x, y);
 }
+
+
+} // namespace lyx