From 8e2babb83385476f08a474891dd8df100626c025 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 23 Feb 2009 19:00:23 +0000 Subject: [PATCH] Fix bug 5797: http://bugzilla.lyx.org/show_bug.cgi?id=5797. GetStatus of an InsetCollapsable asserts for unhandled commands. 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 happens 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. So, we only dispatch to text_ if the cursor is inside the text_. This is not the case for e.g. context menus. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28588 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetText.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index acb296ac6e..1d843502ce 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -271,7 +271,11 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd, 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; } } -- 2.39.5