case LFUN_NEXT_INSET_TOGGLE:
case LFUN_NEXT_INSET_MODIFY: {
// this is the real function we want to invoke
- FuncCode const code =
- (cmd.action == LFUN_NEXT_INSET_TOGGLE)
+ FuncRequest tmpcmd = cmd;
+ tmpcmd.action = (cmd.action == LFUN_NEXT_INSET_TOGGLE)
? LFUN_INSET_TOGGLE : LFUN_INSET_MODIFY;
- FuncRequest const tmpcmd = FuncRequest(code, cmd.argument());
// if there is an inset at cursor, see whether it
// handles the lfun, other start from scratch
Inset * inset = cur.nextInset();
break;
case LFUN_NEXT_INSET_TOGGLE: {
- // this is the real function we want to invoke
- FuncRequest tmpcmd = FuncRequest(LFUN_INSET_TOGGLE, cmd.origin);
+ // create the the real function we want to invoke
+ FuncRequest tmpcmd = cmd;
+ tmpcmd.action = LFUN_INSET_TOGGLE;
// if there is an inset at cursor, see whether it
// wants to toggle.
Inset * inset = cur.nextInset();
Cursor tmpcur = cur;
tmpcur.pushBackward(*inset);
inset->dispatch(tmpcur, tmpcmd);
- if (tmpcur.result().dispatched()) {
+ if (tmpcur.result().dispatched())
cur.dispatched();
- }
- } else if (inset->editable() == Inset::IS_EDITABLE) {
- inset->edit(cur, true);
- }
+ } else
+ inset->dispatch(cur, tmpcmd);
}
// if it did not work, try the underlying inset.
if (!inset || !cur.result().dispatched())
}
case LFUN_NEXT_INSET_MODIFY: {
- // this is the real function we want to invoke
- FuncRequest tmpcmd = FuncRequest(LFUN_INSET_MODIFY, cmd.argument());
+ // create the the real function we want to invoke
+ FuncRequest tmpcmd = cmd;
+ tmpcmd.action = LFUN_INSET_MODIFY;
// if there is an inset at cursor, see whether it
// can be modified.
Inset * inset = cur.nextInset();