- LFUN_LINE_INSERT ("line-insert"): use "inset-insert line" instead.
+- LFUN_TOC_INSERT ("toc-insert"): use "inset-insert toc" instead.
+
The following LyX functions have been changed:
End
Menu "insert_toc"
- Item "Table of Contents|C" "toc-insert"
+ Item "Table of Contents|C" "inset-insert toc"
FloatListInsert
IndicesLists
Item "Nomenclature|N" "nomencl-print"
LFUN_CELL_SPLIT,
LFUN_BUFFER_CHILD_OPEN, // Ale 970528
// 155
- LFUN_TOC_INSERT, // Lgb 97-05-27
+ LFUN_INSET_COPY_AS, // vfr, 20100419
LFUN_FLOAT_LIST_INSERT, // Lgb 20010503
LFUN_BUFFER_TOGGLE_READ_ONLY, // Lgb 97-05-27
LFUN_VC_REGISTER, // Lgb 97-07-01
LFUN_SPELLING_REMOVE, // switt 20100728
LFUN_PREVIEW_INSERT, // vfr, 20100328
LFUN_FORWARD_SEARCH,
- LFUN_INSET_COPY_AS, // vfr, 20100419
LFUN_LASTACTION // end of the table
};
* \endvar
*/
{ LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit },
-/*!
- * \var lyx::FuncCode lyx::LFUN_TOC_INSERT
- * \li Action: Inserts table of contents.
- * \li Syntax: toc-insert
- * \li Origin: Lgb, 27 May 97
- * \endvar
- */
- { LFUN_TOC_INSERT, "toc-insert", Noop, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_APPENDIX
* \li Action: Start (or remove) Appendix on the given cursor position.
}
case LFUN_NOMENCL_PRINT:
- case LFUN_TOC_INSERT:
case LFUN_NEWPAGE_INSERT:
// do nothing fancy
doInsertInset(cur, this, cmd, false, false);
// 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;
}
return new InsetPrintNomencl(buf, icp);
}
- case LFUN_TOC_INSERT:
- return new InsetTOC(buf, InsetCommandParams(TOC_CODE));
-
case LFUN_INFO_INSERT: {
InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument()));
inset->updateInfo();
params.clear();
if (in.empty())
return false;
+ // This happens when inset-insert is called without argument except for the
+ // inset type; ex:
+ // "inset-insert toc"
+ if (in == name)
+ return true;
istringstream data(in);
Lexer lex;
lex.setStream(data);