mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 23:07:43 +00:00
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. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28629 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
4b775f5393
commit
f03d2fb6ef
@ -644,7 +644,7 @@ void Cursor::getSurroundingPos(pos_type & left_pos, pos_type & right_pos)
|
||||
// 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"
|
||||
|
Loading…
Reference in New Issue
Block a user