]> git.lyx.org Git - features.git/commitdiff
Fix bug #11850.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 25 Apr 2020 05:05:15 +0000 (01:05 -0400)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:57 +0000 (15:48 +0200)
When we copy the paragraphs, the Buffer members for the insets are
not set. As a result, we crash when attempting to access them.

src/Text.cpp

index 1820f0548be9def237c7540673dc62e64e6e00d8..fa4e2a8c9a4d8964518150246659db886edeb6f8 100644 (file)
@@ -1801,8 +1801,11 @@ bool Text::dissolveInset(Cursor & cur)
        pos_type spos = cur.pos();
        pit_type spit = cur.pit();
        ParagraphList plist;
-       if (cur.lastpit() != 0 || cur.lastpos() != 0)
+       if (cur.lastpit() != 0 || cur.lastpos() != 0) {
                plist = paragraphs();
+               for (auto & p : plist)
+                       p.setInsetBuffers(*cur.buffer());
+       }
        cur.popBackward();
        // update cursor offset
        if (spit == 0)