]> git.lyx.org Git - features.git/commitdiff
Fix bug #8166: Crash on clicking away from empty last paragraph
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 23 May 2012 06:02:40 +0000 (08:02 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 23 May 2012 06:02:40 +0000 (08:02 +0200)
This reverts the previous fix in [0a33374c/lyxgit] and fixes it
differently.

We always have to call 'notifyCursorLeaves', but we only have to make sure
that we call the 'fixIfBroken()' functions first.

src/BufferView.cpp

index 1017cea7c0212428c307cdfec50342d46453094a..9b6c6b3c18c2724b0c62e09743cbe926e20755e3 100644 (file)
@@ -2201,8 +2201,8 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 
        // Notify left insets
        if (cur != old) {
-               bool badcursor = old.fixIfBroken() || cur.fixIfBroken()
-                               || notifyCursorLeavesOrEnters(old, cur);
+               bool badcursor = old.fixIfBroken() | cur.fixIfBroken();
+               badcursor |= notifyCursorLeavesOrEnters(old, cur);
                if (badcursor)
                        cursor().fixIfBroken();
        }