v...@lyx.org schreef:
Author: vfr
Date: Thu Feb 26 22:29:19 2009
New Revision: 28629
URL: http://www.lyx.org/trac/changeset/28629
Log:
Fix bug 5765: http://bugzilla.lyx.org/show_bug.cgi?id=5765.
[visual cursor] Crash when cutting a figure caption and moving the cursor.
Avoid negative positions.
Modified:
lyx-devel/trunk/src/Cursor.cpp
Modified: lyx-devel/trunk/src/Cursor.cpp
URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/Cursor.cpp?rev=28629
==============================================================================
--- lyx-devel/trunk/src/Cursor.cpp (original)
+++ lyx-devel/trunk/src/Cursor.cpp Thu Feb 26 22:29:19 2009
@@ -644,7 +644,7 @@
// The cursor is painted *before* the character at pos(), or, if
'boundary'
// is true, *after* the character at (pos() - 1). So we already have one
// known position around the cursor:
- pos_type known_pos = boundary() ? pos() - 1 : pos();
+ pos_type known_pos = boundary() && pos() > 0 ? pos() - 1 : pos();
// edge case: if we're at the end of the paragraph, things are a little
// different (because lastpos is a position which does not really "exist"
Also for branch ?
Vincent