From 305d24217fd877107dd4e3efa245bde81f223b28 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 9 Apr 2009 22:15:06 +0000 Subject: [PATCH] Allow LFUNs to be relayed from InsetText to Inset if they are not supposed to be handled by the Text. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29168 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetText.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 0232078b7e..eeb40022b3 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -255,7 +255,15 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd) { LYXERR(Debug::ACTION, "InsetText::doDispatch()" << " [ cmd.action = " << cmd.action << ']'); - text_.dispatch(cur, cmd); + + // Dispatch only to text_ if the cursor is inside + // the text_. It is not for context menus (bug 5797). + if (cur.text() == &text_) + text_.dispatch(cur, cmd); + else + //FIXME we probably also want to dispatch to Inset when + //text_ could do nothing with the FuncRequest. + Inset::doDispatch(cur, cmd); } @@ -279,7 +287,8 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd, // the text_. It is not for context menus (bug 5797). if (cur.text() == &text_) return text_.getStatus(cur, cmd, status); - return false; + else + return Inset::getStatus(cur, cmd, status); } } -- 2.39.2