]> git.lyx.org Git - features.git/commitdiff
Fix crash
authorGuillaume Munch <gm@lyx.org>
Tue, 31 Jan 2017 21:52:12 +0000 (22:52 +0100)
committerGuillaume Munch <gm@lyx.org>
Tue, 31 Jan 2017 21:55:00 +0000 (22:55 +0100)
Thanks Kornel for the report:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg198630.html

Apparently sanitize can crash. Use the safer fixIfBroken even though it
truncates the cursor.

src/frontends/qt4/GuiView.cpp

index a6b5877be1e67a9f8a114c65d378ef828136e273..7edbcc54216ea41bd6d2ea80c9e93d8b9727a021 100644 (file)
@@ -1655,7 +1655,7 @@ void GuiView::structureChanged()
        // This is called from the Buffer, which has no way to ensure that cursors
        // in BufferView remain valid.
        if (documentBufferView())
-               documentBufferView()->cursor().sanitize();
+               documentBufferView()->cursor().fixIfBroken();
        // FIXME: This is slightly expensive, though less than the tocBackend update
        // (#9880). This also resets the view in the Toc Widget (#6675).
        d.toc_models_.reset(documentBufferView());