* src/BufferView.cpp:

- reintroduce check for dispatch state

* src/insets/InsetCaption.cpp:
	- disable LFUN_INSET_TOGGLE

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23929 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-03-24 18:22:54 +00:00
parent 241a8442d7
commit 499d2a991d
2 changed files with 22 additions and 23 deletions

View File

@ -877,14 +877,12 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
break; break;
} }
// if it did not work, try the underlying inset. // if it did not work, try the underlying inset.
inset = &cur.inset(); if (!inset || !cur.result().dispatched())
if (inset) { getStatus(tmpcmd);
inset->getStatus(cur, tmpcmd, flag);
return flag; if (!cur.result().dispatched())
break; // else disable
} flag.enabled(false);
// else disable
flag.enabled(false);
break; break;
} }
@ -900,14 +898,12 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
break; break;
} }
// if it did not work, try the underlying inset. // if it did not work, try the underlying inset.
inset = &cur.inset(); if (!inset || !cur.result().dispatched())
if (inset) { getStatus(tmpcmd);
inset->getStatus(cur, tmpcmd, flag);
return flag; if (!cur.result().dispatched())
break; // else disable
} flag.enabled(false);
// else disable
flag.enabled(false);
break; break;
} }
@ -1335,9 +1331,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
} }
} }
// if it did not work, try the underlying inset. // if it did not work, try the underlying inset.
else if (&cur.inset()) if (!inset || !cur.result().dispatched())
cur.inset().dispatch(cur, tmpcmd); cur.dispatch(tmpcmd);
else
if (!cur.result().dispatched())
// It did not work too; no action needed. // It did not work too; no action needed.
break; break;
cur.clearSelection(); cur.clearSelection();
@ -1354,9 +1351,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
if (inset) if (inset)
inset->dispatch(cur, tmpcmd); inset->dispatch(cur, tmpcmd);
// if it did not work, try the underlying inset. // if it did not work, try the underlying inset.
else if (&cur.inset()) if (!inset || !cur.result().dispatched())
cur.inset().dispatch(cur, tmpcmd); cur.dispatch(tmpcmd);
else
if (!cur.result().dispatched())
// It did not work too; no action needed. // It did not work too; no action needed.
break; break;
cur.clearSelection(); cur.clearSelection();
@ -1572,7 +1570,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
// Now dispatch to the temporary cursor. If the real cursor should // Now dispatch to the temporary cursor. If the real cursor should
// be modified, the inset's dispatch has to do so explicitly. // be modified, the inset's dispatch has to do so explicitly.
if (!cur.result().dispatched()) if (!inset || !cur.result().dispatched())
cur.dispatch(cmd); cur.dispatch(cmd);
// Notify left insets // Notify left insets

View File

@ -194,6 +194,7 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_BREAK_PARAGRAPH: case LFUN_BREAK_PARAGRAPH:
case LFUN_BREAK_PARAGRAPH_SKIP: case LFUN_BREAK_PARAGRAPH_SKIP:
case LFUN_INSET_TOGGLE:
status.enabled(false); status.enabled(false);
return true; return true;