]> git.lyx.org Git - features.git/commitdiff
Make fixIfBroken() more robust
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 15 Jun 2017 09:49:49 +0000 (11:49 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 17 Jun 2017 11:07:36 +0000 (13:07 +0200)
Chop slice when its inset is not editable.

Fixes bug #10667.

(cherry picked from commit 522516d99eff64c0d1b339c951ef0e0d61a74394)

src/DocIterator.cpp
status.22x

index a059ad18d2110b52fe88153b65ef4d5669ed288e..a3d81caadb81cab504bd195eaf8b38c53955d88c 100644 (file)
@@ -535,7 +535,7 @@ bool DocIterator::fixIfBroken()
        size_t n = slices_.size();
        for (; i != n; ++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
                        --i;
                        LYXERR(Debug::DEBUG, "fixIfBroken(): inset changed");
index 4a56ac4565797bd4a9cf52d2329512bf41eb3a3c..21afca76975b041c14de7fc9ea3baa188e88fc73 100644 (file)
@@ -79,6 +79,8 @@ What's new
 
 - 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).