[LyX/2.3.x] Fix pasting of math grid with more rows in source than target (#11897)

Juergen Spitzmueller spitz at lyx.org
Tue Jun 30 06:43:11 UTC 2020


commit 83d76a66f66fa2da5c4ae454b0442463b79af244
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Jun 30 09:06:40 2020 +0200

    Fix pasting of math grid with more rows in source than target (#11897)
---
 src/mathed/InsetMathGrid.cpp |    2 +-
 status.23x                   |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 2287afb..eb8c4ff 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -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) {
diff --git a/status.23x b/status.23x
index 4a46545..92a3fe6 100644
--- a/status.23x
+++ b/status.23x
@@ -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


More information about the lyx-cvs mailing list