Juergen Spitzmueller wrote:
// cursor position might be invalid now + cur.pit() = cur.lastpit(); cur.pos() = cur.lastpos(); cur.clearSelection();
You are right! I compiled a debug version and this was exactly where it crashed when pressing delete. Your patch solves the problem.
At first I didn't notice because I triggered the crash by changing the text style. So there are some more places where the same error is made with lastpos.
With the attached patch it doesn't crash anymore. There is still one odd thing: When applying a text style to a number of selected cells in my example file, only the first list item actually gets the style (this bug also existed before the patch).
Joost
Index: insettabular.C =================================================================== --- insettabular.C (revision 15069) +++ insettabular.C (working copy) @@ -684,6 +684,7 @@ if (insertAsciiString(cur.bv(), clip, false)) { // content has been replaced, // so cursor might be invalid + cur.pit() = cur.lastpit(); cur.pos() = cur.lastpos(); bvcur.setCursor(cur); break; @@ -733,6 +734,7 @@ // cursor follows cell: cur.idx() = tabular.getCellNumber(i, j); // select this cell only: + cur.pit() = 0; cur.pos() = 0; cur.resetAnchor(); cur.pos() = cur.top().lastpos(); @@ -1757,6 +1759,7 @@ } // cursor position might be invalid now + cur.pit() = cur.lastpit(); cur.pos() = cur.lastpos(); cur.clearSelection(); }