From 70c8d87745ba7d6def7fbcb29ec00c56ac7abf80 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Mon, 5 Nov 2007 09:51:37 +0000 Subject: [PATCH] Fix bug 4323/2, and more logical naming of addRow git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21429 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathArray.cpp | 2 +- src/mathed/InsetMathGrid.cpp | 10 +++++----- src/mathed/InsetMathGrid.h | 6 +++--- src/mathed/InsetMathHull.cpp | 4 ++-- src/mathed/MathParser.cpp | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mathed/InsetMathArray.cpp b/src/mathed/InsetMathArray.cpp index 8ce2b8f676..31b5f4f9b3 100644 --- a/src/mathed/InsetMathArray.cpp +++ b/src/mathed/InsetMathArray.cpp @@ -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) diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 0da03a9df0..f4f70b2b2d 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -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") { diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index 7683ad6305..d010850894 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -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); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index e5e25e7b00..f344cc1e3c 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -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; diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index daac331da5..2a1d9186c4 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -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 -- 2.39.5