From ba3269fd8f9e32647bc314969ee344ae56cc4cd3 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 1 Feb 2016 16:56:59 +0100 Subject: [PATCH] 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 --- src/insets/InsetTabular.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1ba5effc67..993368a6cc 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3965,9 +3965,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) || cmd.x() > xo(cur.bv()) + tabular.width()) { row_type r = rowFromY(cur, cmd.y()); cur.idx() = tabular.getFirstCellInRow(r); + cur.pit() = 0; cur.pos() = 0; cur.resetAnchor(); cur.idx() = tabular.getLastCellInRow(r); + cur.pit() = cur.lastpit(); cur.pos() = cur.lastpos(); cur.setSelection(true); bvcur = cur; @@ -3980,9 +3982,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) || cmd.y() > y0 + tabular.height()) { col_type c = columnFromX(cur, cmd.x()); cur.idx() = tabular.cellIndex(0, c); + cur.pit() = 0; cur.pos() = 0; cur.resetAnchor(); cur.idx() = tabular.cellIndex(tabular.nrows() - 1, c); + cur.pit() = cur.lastpit(); cur.pos() = cur.lastpos(); cur.setSelection(true); bvcur = cur;