break;
}
- case LFUN_LINE_INSERT: {
- InsetCommandParams p(LINE_CODE);
- p["offset"] = from_ascii(".5ex");
- p["width"] = from_ascii("100col%");
- p["height"] = from_ascii("1pt");
- string const data = InsetCommand::params2string("line", p);
-
- if (cmd.argument().empty()) {
- bv->showDialog("line", data);
- } else {
- FuncRequest fr(LFUN_INSET_INSERT, data);
- dispatch(cur, fr);
- }
- break;
- }
-
case LFUN_INFO_INSERT: {
Inset * inset;
if (cmd.argument().empty() && cur.selection()) {
}
case LFUN_NOMENCL_PRINT:
- case LFUN_TOC_INSERT:
case LFUN_NEWPAGE_INSERT:
// do nothing fancy
doInsertInset(cur, this, cmd, false, false);
case LFUN_LABEL_INSERT:
code = LABEL_CODE;
break;
- case LFUN_LINE_INSERT:
- code = LINE_CODE;
- break;
case LFUN_INFO_INSERT:
code = INFO_CODE;
break;
// not allowed in description items
enable = !inDescriptionItem(cur);
break;
- case LFUN_TOC_INSERT:
- code = TOC_CODE;
- // not allowed in description items
- enable = !inDescriptionItem(cur);
- break;
case LFUN_HYPERLINK_INSERT:
if (cur.selIsMultiCell() || cur.selIsMultiLine()) {
enable = false;
case LFUN_LINE_END:
case LFUN_CHAR_DELETE_FORWARD:
case LFUN_CHAR_DELETE_BACKWARD:
- case LFUN_INSET_INSERT:
case LFUN_WORD_UPCASE:
case LFUN_WORD_LOWCASE:
case LFUN_WORD_CAPITALIZE:
enable = true;
break;
+ case LFUN_INSET_INSERT: {
+ string const type = cmd.getArg(0);
+ if (type == "toc") {
+ code = TOC_CODE;
+ // not allowed in description items
+ //FIXME: couldn't this be merged in Inset::insetAllowed()?
+ enable = !inDescriptionItem(cur);
+ } else {
+ enable = true;
+ }
+ break;
+ }
+
default:
return false;
}