]> git.lyx.org Git - lyx.git/commitdiff
Fix bug 4323/2, and more logical naming of addRow
authorMartin Vermeer <martin.vermeer@hut.fi>
Mon, 5 Nov 2007 09:51:37 +0000 (09:51 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Mon, 5 Nov 2007 09:51:37 +0000 (09:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21429 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathArray.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/MathParser.cpp

index 8ce2b8f676758bab948de7553bc1fead6610f8a4..31b5f4f9b3dc3f9e53dcbee0f66019b34536fbf2 100644 (file)
@@ -63,7 +63,7 @@ InsetMathArray::InsetMathArray(docstring const & name, docstring const & str)
        }
 
        for (row_type row = 1; row < dat.size(); ++row)
-               addRow(0);
+               appendRow(0);
        for (col_type col = 1; col < dat[0].size(); ++col)
                addCol(0);
        for (row_type row = 0; row < dat.size(); ++row)
index 0da03a9df0f5e5fce66d8ba9022ce34e0062fd01..f4f70b2b2da3581c2755b633775af89ad6fa7863 100644 (file)
@@ -677,7 +677,7 @@ docstring InsetMathGrid::eocString(col_type col, col_type lastcol) const
 }
 
 
-void InsetMathGrid::addRow(row_type row)
+void InsetMathGrid::appendRow(row_type row)
 {
        rowinfo_.insert(rowinfo_.begin() + row + 1, RowInfo());
        cells_.insert
@@ -715,7 +715,7 @@ void InsetMathGrid::delRow(row_type row)
 
 void InsetMathGrid::copyRow(row_type row)
 {
-       addRow(row);
+       appendRow(row);
        for (col_type col = 0; col < ncols(); ++col)
                cells_[(row + 1) * ncols() + col] = cells_[row * ncols() + col];
 }
@@ -1121,7 +1121,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_BREAK_LINE: {
                cur.recordUndoInset();
                row_type const r = cur.row();
-               addRow(r);
+               appendRow(r);
 
                // split line
                for (col_type c = col(cur.idx()) + 1; c < ncols(); ++c)
@@ -1159,7 +1159,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        halign('c', cur.col());
                else if (s == "append-row")
                        for (int i = 0, n = extractInt(is); i < n; ++i)
-                               addRow(cur.row());
+                               appendRow(cur.row());
                else if (s == "delete-row") {
                        for (int i = 0, n = extractInt(is); i < n; ++i) {
                                delRow(cur.row());
@@ -1195,7 +1195,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        row_type const r = cur.row();
                        col_type const c = cur.col();
                        for (int i = 0, n = extractInt(is); i < n; ++i)
-                               addCol(cur.col());
+                               addCol(cur.col() + 1);
                        cur.idx() = index(r, c);
                }
                else if (s == "delete-column") {
index 7683ad6305a9a22d9cdf99a80cd7b9bc1a67b5b0..d01085089417c2b5b5aa72c4f0d2fa5f698efd5c 100644 (file)
@@ -167,15 +167,15 @@ public:
        /// pulls cell after pressing erase
        void idxGlue(idx_type idx);
 
-       /// add a row
-       virtual void addRow(row_type r);
+       /// add a row, one row down
+       virtual void appendRow(row_type r);
        /// delete a row
        virtual void delRow(row_type r);
        /// copy a row
        virtual void copyRow(row_type r);
        /// swap two rows
        virtual void swapRow(row_type r);
-       /// add a column
+       /// add a column, here
        virtual void addCol(col_type c);
        /// delete a column
        virtual void delCol(col_type c);
index e5e25e7b009ab10763a60f0930026ae025d9c21a..f344cc1e3c4eabbefdad8651e2db958de1c11462 100644 (file)
@@ -622,7 +622,7 @@ void InsetMathHull::addRow(row_type row)
                return;
        nonum_.insert(nonum_.begin() + row + 1, !numberedType());
        label_.insert(label_.begin() + row + 1, docstring());
-       InsetMathGrid::addRow(row);
+       InsetMathGrid::appendRow(row);
 }
 
 
@@ -1019,7 +1019,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
                MathData ar = cur.cell();
                lyxerr << "use cell: " << ar << endl;
                // FIXME: temporarily disabled
-               addRow(cur.row());
+               appendRow(cur.row());
                ++cur.idx();
                ++cur.idx();
                cur.cell() = eq;
index daac331da5734fb5544812ff239a3d64e3c517b4..2a1d9186c420022478754b028b3e2fcfd694c3cc 100644 (file)
@@ -116,7 +116,7 @@ bool addRow(InsetMathGrid & grid, InsetMathGrid::row_type & cellrow,
        ++cellrow;
        if (cellrow == grid.nrows()) {
                //lyxerr << "adding row " << cellrow << endl;
-               grid.addRow(cellrow - 1);
+               grid.appendRow(cellrow - 1);
                if (cellrow == grid.nrows()) {
                        // We can't add a row to this grid, so let's
                        // append the content of this cell to the previous