Make fixIfBroken() more robust

Chop slice when its inset is not editable.

Fixes bug #10667.

(cherry picked from commit 522516d99e)
This commit is contained in:
Jean-Marc Lasgouttes 2017-06-15 11:49:49 +02:00
parent f7aabdd9fa
commit 1c07c0dc38
2 changed files with 3 additions and 1 deletions

View File

@ -535,7 +535,7 @@ bool DocIterator::fixIfBroken()
size_t n = slices_.size(); size_t n = slices_.size();
for (; i != n; ++i) { for (; i != n; ++i) {
CursorSlice & cs = slices_[i]; CursorSlice & cs = slices_[i];
if (&cs.inset() != inset) { if (&cs.inset() != inset || !cs.inset().editable()) {
// the whole slice is wrong, chop off this as well // the whole slice is wrong, chop off this as well
--i; --i;
LYXERR(Debug::DEBUG, "fixIfBroken(): inset changed"); LYXERR(Debug::DEBUG, "fixIfBroken(): inset changed");

View File

@ -79,6 +79,8 @@ What's new
- Fix potential crash when cursor enters an inset (bug 10691). - Fix potential crash when cursor enters an inset (bug 10691).
- Fix random crash when dissolving inset (bug 10667).
- Avoid a case of stuck cursor after entering an inset (bug 10630). - Avoid a case of stuck cursor after entering an inset (bug 10630).