]> git.lyx.org Git - features.git/commitdiff
Allow LFUNs to be relayed from InsetText to Inset if they are not supposed to be...
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 9 Apr 2009 22:15:06 +0000 (22:15 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 9 Apr 2009 22:15:06 +0000 (22:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29168 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetText.cpp

index 0232078b7ef66d0e6f765f9ebc745293528e768f..eeb40022b308caf7ca28cd86edbe8b8134c42ab6 100644 (file)
@@ -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);
        }
 }