mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Fix another crash with Grid pasting (follow-up to #11906)
This commit is contained in:
parent
2dae4ab4f3
commit
957b615b1f
@ -1634,8 +1634,10 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
for (row_type r = 0; r < numrows; ++r) {
|
||||
for (col_type c = 0; c < numcols; ++c) {
|
||||
idx_type i = index(r + startrow, c + startcol);
|
||||
cell(i).insert(c == 0 ? cur.pos() : 0,
|
||||
grid.cell(grid.index(r, c)));
|
||||
pos_type ipos = uint(cur.pos()) > cell(i).size()
|
||||
? cell(i).size()
|
||||
: cur.pos();
|
||||
cell(i).insert(ipos, grid.cell(grid.index(r, c)));
|
||||
}
|
||||
if (hline_enabled)
|
||||
rowinfo_[r].lines += grid.rowinfo_[r].lines;
|
||||
|
Loading…
Reference in New Issue
Block a user