]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.C
make it compile again (hopefully)
[lyx.git] / src / mathed / InsetMathGrid.C
index 06b53ae5c45a52ce7eab45ed5f7f962ae0fbca6b..8c160fc63961ba36078bd0485311020cd285990b 100644 (file)
@@ -44,7 +44,6 @@ using std::string;
 using std::auto_ptr;
 using std::istream;
 using std::istringstream;
-using std::ostringstream;
 using std::vector;
 
 
@@ -60,12 +59,12 @@ public:
        ///
        virtual string const inset2string(Buffer const &) const
        {
-               ostringstream data;
+               lyx::odocstringstream data;
                //data << name() << " active_cell " << inset.getActCell() << '\n';
-               data << name() << " active_cell " << 0 << '\n';
+               data << lyx::from_utf8(name()) << " active_cell " << 0 << '\n';
                WriteStream ws(data);
                inset_.write(ws);
-               return data.str();
+               return lyx::to_utf8(data.str());
        }
 
 protected:
@@ -784,7 +783,7 @@ bool InsetMathGrid::idxUpDown(LCursor & cur, bool up) const
                        return false;
                cur.idx() += ncols();
        }
-       cur.pos() = cur.cell().x2pos(cur.x_target() - cur.cell().xo());
+       cur.pos() = cur.cell().x2pos(cur.x_target() - cur.cell().xo(cur.bv()));
        return true;
 }
 
@@ -1210,7 +1209,9 @@ void InsetMathGrid::doDispatch(LCursor & cur, FuncRequest & cmd)
                int n = 0;
                is >> n;
                InsetMathGrid grid(1, 1);
-               mathed_parse_normal(grid, lyx::cap::getSelection(cur.buffer(), n));
+               // FIXME UNICODE
+               mathed_parse_normal(grid,
+                       lyx::to_utf8(lyx::cap::getSelection(cur.buffer(), n)));
                if (grid.nargs() == 1) {
                        // single cell/part of cell
                        recordUndo(cur);