]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathGrid.cpp
Substack support for XHTML.
[lyx.git] / src / mathed / InsetMathGrid.cpp
index daaa4276a7acd72aafe39ed08834b3a756133f98..c9f9ed2537f8c0377ceebfa5e8ba54aab7ece50d 100644 (file)
@@ -67,9 +67,9 @@ static int extractInt(istream & is)
 static void resetGrid(InsetMathGrid & grid)
 {
        while (grid.ncols() > 1)
-               grid.delCol(grid.ncols());
+               grid.delCol(grid.ncols() - 1);
        while (grid.nrows() > 1)
-               grid.delRow(grid.nrows());
+               grid.delRow(grid.nrows() - 1);
        grid.cell(0).erase(0, grid.cell(0).size());
        grid.setDefaults();
 }
@@ -986,14 +986,14 @@ void InsetMathGrid::mathmlize(MathStream & os) const
        char const * const celltag = havetable ? "mtd" : "mrow";
        for (row_type row = 0; row < nrows(); ++row) {
                if (havetable)
-                       os << MTag("mtr");;
+                       os << MTag("mtr");
                for (col_type col = 0; col < ncols(); ++col) {
                        os << MTag(celltag);
                        os << cell(index(row, col));
                        os << ETag(celltag);
                }
                if (havetable)
-                       os << ETag("mtr");;
+                       os << ETag("mtr");
        }
        if (havetable)
                os << ETag("mtable");
@@ -1011,13 +1011,13 @@ void InsetMathGrid::htmlize(HtmlStream & os, string attrib) const
        }
        os << MTag("table", attrib);
        for (row_type row = 0; row < nrows(); ++row) {
-               os << MTag("tr");;
+               os << MTag("tr");
                for (col_type col = 0; col < ncols(); ++col) {
                        os << MTag("td");
                        os << cell(index(row, col));
                        os << ETag("td");
                }
-               os << ETag("tr");;
+               os << ETag("tr");
        }
        os << ETag("table");
 }
@@ -1191,7 +1191,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                if (cur.idx() > 0)
                        --cur.idx();
                cur.pos() = cur.lastpos();
-
+               cur.forceBufferUpdate();
                //mathcursor->normalize();
                //cmd = FuncRequest(LFUN_FINISHED_BACKWARD);
                break;
@@ -1534,7 +1534,7 @@ bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
        }
 
        case LFUN_CELL_SPLIT:
-               status.setEnabled(true);
+               status.setEnabled(cur.idx() != cur.lastidx());
                return true;
 
        case LFUN_CELL_BACKWARD: