Vincent van Ravesteijn wrote:
> commit 0a33374c0d8125e27666fe513506fb6069df453c
> Author: Vincent van Ravesteijn <v...@lyx.org>
> Date:   Wed May 23 01:31:43 2012 +0200
> 
>     Fix bug #8166: Crash on clicking away from empty paragraph
>     
>     We rely on the 'or' operator to prevent us from calling
>     'notifyCursorLeaves' if one of the two cursors is broken. This doesn't
>     work when using the '|' operator. The compiler 'optimizes' the code in
>     such a way that we always call notifyCursorLeaves anyway. Using the '||'
>     operator fixes this.

My memory is not particularly good device, but IIRC notifyCursorLeavesOrEnters
call should _never_ be optimized-out when using single |.
So what makes difference between Win X Linux noted in the bug would be the order
of function calls (which is undefined and thus nonportable by definition).

Currently you rewrite it as:
if old.fixIfBroken()
        if cur.fixIfBroken()
                notifyCursorLeavesOrEnters(old, cur);

Maybe cur.fixIfBroken() should be called anyway --> (fix|fix)||notify ?

Can you clarify what is the intended logic && function calls you are trying to 
achieve?

Pavel

Reply via email to