]> git.lyx.org Git - lyx.git/commitdiff
Fix pasting of math grid with more rows in source than target (#11897)
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 29 Jun 2020 07:48:05 +0000 (09:48 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 29 Jun 2020 07:48:05 +0000 (09:48 +0200)
src/mathed/InsetMathGrid.cpp

index d6f275a3aaf518e6492af5e6f00d6e83190be159..52283b576b393ca2c19e032f21ad9ce5e57fd5cd 100644 (file)
@@ -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 {