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:
Jean-Marc Lasgouttes 2016-02-01 16:56:59 +01:00
parent ef81af7037
commit ba3269fd8f

View File

@ -3965,9 +3965,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;
@ -3980,9 +3982,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;