Hi All,
When you add a command to the context menu of an InsetCollapsable of
which the getStatus method does not handle this command, an assertion
will be raised. This also happens when you do something wrong with
context menus (bug 5796).
When getStatus doesn't handle a command it is forwarded to
text::getStatus which asserts because 'cur.text()' is the text the inset
is in, while 'this' is the text of the inset. Therefore, I think that
when InsetText gets a request it should not always dispatch it to the
Text when it does not know how to handle it.
Is the attached fix OK ?
Vincent
Index: src/insets/InsetText.cpp
===================================================================
--- src/insets/InsetText.cpp (revision 28468)
+++ src/insets/InsetText.cpp (working copy)
@@ -271,7 +271,11 @@
status.setEnabled(allowParagraphCustomization());
return true;
default:
- return text_.getStatus(cur, cmd, status);
+ // Dispatch only to text_ if the cursor is inside
+ // the text_. It is not for context menus (bug 5797).
+ if (cur.text() == &text_)
+ return text_.getStatus(cur, cmd, status);
+ return false;
}
}