mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
When selecting whole row, reset properly the pit()
Since different cells in a row can have different number of paragraph, take care of setting cur.pit() when selecting a row/column. Fixes bug #9955
This commit is contained in:
parent
67fa69ce6b
commit
169cf7c24d
@ -3969,9 +3969,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
|| cmd.x() > xo(cur.bv()) + tabular.width()) {
|
|| cmd.x() > xo(cur.bv()) + tabular.width()) {
|
||||||
row_type r = rowFromY(cur, cmd.y());
|
row_type r = rowFromY(cur, cmd.y());
|
||||||
cur.idx() = tabular.getFirstCellInRow(r);
|
cur.idx() = tabular.getFirstCellInRow(r);
|
||||||
|
cur.pit() = 0;
|
||||||
cur.pos() = 0;
|
cur.pos() = 0;
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
cur.idx() = tabular.getLastCellInRow(r);
|
cur.idx() = tabular.getLastCellInRow(r);
|
||||||
|
cur.pit() = cur.lastpit();
|
||||||
cur.pos() = cur.lastpos();
|
cur.pos() = cur.lastpos();
|
||||||
cur.setSelection(true);
|
cur.setSelection(true);
|
||||||
bvcur = cur;
|
bvcur = cur;
|
||||||
@ -3984,9 +3986,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
|| cmd.y() > y0 + tabular.height()) {
|
|| cmd.y() > y0 + tabular.height()) {
|
||||||
col_type c = columnFromX(cur, cmd.x());
|
col_type c = columnFromX(cur, cmd.x());
|
||||||
cur.idx() = tabular.cellIndex(0, c);
|
cur.idx() = tabular.cellIndex(0, c);
|
||||||
|
cur.pit() = 0;
|
||||||
cur.pos() = 0;
|
cur.pos() = 0;
|
||||||
cur.resetAnchor();
|
cur.resetAnchor();
|
||||||
cur.idx() = tabular.cellIndex(tabular.nrows() - 1, c);
|
cur.idx() = tabular.cellIndex(tabular.nrows() - 1, c);
|
||||||
|
cur.pit() = cur.lastpit();
|
||||||
cur.pos() = cur.lastpos();
|
cur.pos() = cur.lastpos();
|
||||||
cur.setSelection(true);
|
cur.setSelection(true);
|
||||||
bvcur = cur;
|
bvcur = cur;
|
||||||
|
Loading…
Reference in New Issue
Block a user