mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
Consider single-cell insets when pasting multiple cells (#11906)
This commit is contained in:
parent
501f4e848f
commit
61cf165521
@ -1649,7 +1649,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
// append columns for the left over horizontal cells
|
// append columns for the left over horizontal cells
|
||||||
for (InsetMath::col_type c = numcols; c < grid.ncols(); ++c) {
|
for (InsetMath::col_type c = numcols; c < grid.ncols(); ++c) {
|
||||||
addCol(c + startcol);
|
addCol(c + startcol);
|
||||||
idx_type i = index(r + startrow, c + startcol);
|
idx_type i = index(r + startrow, min(c + startcol, ncols() - 1));
|
||||||
cell(i).append(grid.cell(grid.index(r, c)));
|
cell(i).append(grid.cell(grid.index(r, c)));
|
||||||
++numcols;
|
++numcols;
|
||||||
}
|
}
|
||||||
@ -1662,7 +1662,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
row_type crow = startrow + r;
|
row_type crow = startrow + r;
|
||||||
addRow(crow - 1);
|
addRow(crow - 1);
|
||||||
for (col_type c = 0; c < grid.ncols(); ++c)
|
for (col_type c = 0; c < grid.ncols(); ++c)
|
||||||
cell(index(crow, c + startcol)).append(grid.cell(grid.index(r, c)));
|
cell(index(min(crow, nrows() - 1), min(c + startcol, ncols() - 1))).append(grid.cell(grid.index(r, c)));
|
||||||
if (hline_enabled)
|
if (hline_enabled)
|
||||||
rowinfo_[crow].lines += grid.rowinfo_[r].lines;
|
rowinfo_[crow].lines += grid.rowinfo_[r].lines;
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user