>>>>> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Joost Verburg wrote:
>> I don't know when the bug was introduced, I'm very busy updating
>> the Windows installer. However I got at least 20 table crashes
>> while editing a report of a few pages, so it is likely a new bug
>> (or nobody used tables recently?).

Juergen> I believe it's an old one. And I believe the attached patch
Juergen> fixes it (only the second change is relevant. The first one
Juergen> -- in doDispatch -- is the fix for another bug. I don't have
Juergen> a clean tree around).

Instead of fixing cursor position if it looks wrong, shouldn't we set
cursor to the start of selection instead? This is guaranteed to work,
it seems.

I propose the following patch.

JMarc

Index: src/insets/insettabular.C
===================================================================
--- src/insets/insettabular.C	(revision 15086)
+++ src/insets/insettabular.C	(working copy)
@@ -1757,7 +1757,9 @@ void InsetTabular::cutSelection(LCursor 
 	}
 
 	// cursor position might be invalid now
-	cur.pos() = cur.lastpos();
+	cur.idx() = cs;
+	cur.pit() = 0;
+	cur.pos() = 0;
 	cur.clearSelection();
 }
 

Reply via email to