From: Juergen Spitzmueller Date: Mon, 29 Jun 2020 07:48:05 +0000 (+0200) Subject: Fix pasting of math grid with more rows in source than target (#11897) X-Git-Tag: lyx-2.4.0dev-acb2ca7b~688 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=16d0785e6707f98289d27b7364d0ecb82de0a697;p=lyx.git Fix pasting of math grid with more rows in source than target (#11897) --- diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index d6f275a3aa..52283b576b 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1651,8 +1651,9 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) // append the left over vertical cells to the last _cell_ idx_type i = nargs() - 1; for (row_type r = numrows; r < grid.nrows(); ++r) { + addRow(r - 1); for (col_type c = 0; c < grid.ncols(); ++c) - cell(i).append(grid.cell(grid.index(r, c))); + cell(index(r, c)).append(grid.cell(grid.index(r, c))); if (hline_enabled) rowinfo_[r].lines += grid.rowinfo_[r].lines; else {