]> git.lyx.org Git - features.git/commitdiff
Fix bug 5744: http://bugzilla.lyx.org/show_bug.cgi?id=5744.
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 25 Feb 2009 00:39:55 +0000 (00:39 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 25 Feb 2009 00:39:55 +0000 (00:39 +0000)
Crash with completion in mathed.

When deleting an inset, the stored DocIterator might contain a reference to a non-existent Inset and Text. Therefore, if we detect that the depth has changed, we are (for sure) not in the same paragraph, but we should make sure not to ask for the innerParagraph.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28596 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 2a5b39f48915efce7f76b1903585bc5f5466971f..40596dd4f402c152155baf9a93955b035dd02c16 100644 (file)
@@ -2453,6 +2453,8 @@ bool samePar(DocIterator const & a, DocIterator const & b)
                return true;
        if (a.empty() || b.empty())
                return false;
+       if (a.depth() != b.depth())
+               return false;
        return &a.innerParagraph() == &b.innerParagraph();
 }