Hi lyx-devel,

   Upon following these steps, I consistently encoutered a crash.

1. New lyx doc.
2. Insert table (I chose 3x3)
3. Select entire table and invoke unset-all-lines from toolbar => CRASH!

  The offending line seemed to be Undo.cpp:488 which was calling (DocIterator) 
cur.pop_back() without checking for the level. It seems any top-level inset 
that is selected would cause this crash if inset-modify is called on it.

  The fix is to allow the pop_back if depth() > 1. Attaching patch created 
within src/

  This brings me to a question. At the top-most level, is the depth 0 or 1? Is 
the depth==1 (and level==0 but this concept is not directly used here?) Am I 
correct?

Thanks,
Manoj
Index: Undo.cpp
===================================================================
--- Undo.cpp	(revision 33612)
+++ Undo.cpp	(working copy)
@@ -485,7 +485,8 @@
 void Undo::recordUndoInset(DocIterator const & cur, UndoKind kind)
 {
 	DocIterator c = cur;
-	c.pop_back();
+	if(c.depth() > 1)
+		c.pop_back();
 	d->doRecordUndo(kind, c, c.pit(), c.pit(), cur, false, d->undostack_);
 }
 

Reply via email to