Am 07.02.2011 um 21:15 schrieb LyX Ticket Tracker:

> #7209: assertion when clicking on unfinished command in math
> Ticket URL: <http://www.lyx.org/trac/ticket/7209#comment:5>
> -----------------------+----------------------------------------------------
> Reporter:  uwestoehr  |        Owner:  poenitz 
>     Type:  defect     |       Status:  reopened
> Priority:  high       |    Milestone:  1.6.9   
> Component:  mathed     |      Version:  1.6.8   
> Severity:  critical   |   Resolution:          
> Keywords:             |  
> -----------------------+----------------------------------------------------
> Changes (by metrics):
> 
>  * status:  closed => reopened
>  * resolution:  fixed =>
> 
> 
> Comment:
> 
> I can still reproduce this (or a related bug) in beta 4. Create a
> displayed math inset, type \var, wait for the autocompletion to appear,
> then _right_ click on the backslash.

Indeed this is a related bug. The menu expansion crashes now in 
MenuDefinition::expandSpellingSuggestions().

I tried to add an early return there if we are in math mode. If I do so I can 
see the real cause for the problem: the right button opens the wrong menu. It 
should be the math context menu and in fact it is the normal text menu. But 
only the first time - if the crash is avoided every following right click opens 
the math menu. So, there is something wrong with the menu binding. I don't know 
enough about that machinery... but the early return patch only hides the root 
cause I think.

Please, can any menu expert have a look?

Stephan

Index: src/frontends/qt4/Menus.cpp
===================================================================
--- src/frontends/qt4/Menus.cpp (Revision 37549)
+++ src/frontends/qt4/Menus.cpp (Arbeitskopie)
@@ -756,6 +756,8 @@
        WordLangTuple wl;
        docstring_list suggestions;
        Cursor const & cur = bv->cursor();
+       if (!cur.inTexted())
+               return;
        Paragraph const & par = cur.paragraph();
        pos_type from = cur.pos();
        pos_type to = from;

Reply via email to