Le 04/01/2019 à 13:56, Jean-Marc Lasgouttes a écrit :
commit a69e01d0b47aebbdfc3139533fcb7f1d0c04f156
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Fri Jan 4 13:57:13 2019 +0100

     Avoid crash when using inset-select-all in tabular
When changing cell idx, it is important to set the pit to a reasonable
     value.

I stumbled on that while investigating #11425. It triggers when using select all in a cell with two paragraphs and the cursor is on the second paragraph.

Riki, this is candidate for branch.

JMarc

---
  src/BufferView.cpp |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 6a32faa..af37287 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1904,10 +1904,12 @@ void BufferView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                        // At least one complete cell is selected and inset is 
a table.
                        // Select all cells
                        cur.idx() = 0;
+                       cur.pit() = 0;
                        cur.pos() = 0;
                        cur.resetAnchor();
                        cur.selection(true);
                        cur.idx() = cur.lastidx();
+                       cur.pit() = cur.lastpit();
                        cur.pos() = cur.lastpos();
                } else {
                        // select current cell


Reply via email to