]> git.lyx.org Git - features.git/commitdiff
Fix pasting of math grid with more rows in source than target (#11897)
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 30 Jun 2020 07:06:40 +0000 (09:06 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 30 Jun 2020 07:06:40 +0000 (09:06 +0200)
src/mathed/InsetMathGrid.cpp
status.23x

index 2287afb4b20ffb7f4efac38c222a2df0e5530a54..eb8c4ffdc6a9cf8c674bc2071ec5c9046295325e 100644 (file)
@@ -1666,7 +1666,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
                        for (row_type r = numrows; r < grid.nrows(); ++r) {
                                for (col_type c = 0; c < grid.ncols(); ++c)
                                        cell(i).append(grid.cell(grid.index(r, c)));
-                               if (hline_enabled)
+                               if (hline_enabled && r <= nrows())
                                        rowinfo_[r].lines_ += grid.rowinfo_[r].lines_;
                                else {
                                        for (unsigned int l = 0; l < grid.rowinfo_[r].lines_; ++l) {
index 4a465454e0b53ff2c765acb953c3272d01f7efdc..92a3fe637f276731246784cb155eb09a7b7e6141 100644 (file)
@@ -51,6 +51,9 @@ What's new
 
 * USER INTERFACE
 
+- Fix crash when pasting math grid with more rows in source than target
+  (bug 11897).
+
 - Fix problem with drawing of auto-opened insets (bug 11870).
 
 - Fix crash when rejecting changes and the cursor is in an inset that will be