X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.C;h=19092859965d9c53a562103e3f8a4a8322488d1f;hb=e7f4618bcce770369cf46335c2c7f0164b4b8857;hp=43930ac8c5e64b960f7cd416ffa463d5ee4c4f17;hpb=de6418f37765fe452f135f96dee6d49897bff215;p=lyx.git diff --git a/src/factory.C b/src/factory.C index 43930ac8c5..1909285996 100644 --- a/src/factory.C +++ b/src/factory.C @@ -37,6 +37,7 @@ #include "insets/insethfill.h" #include "insets/insetinclude.h" #include "insets/insetindex.h" +#include "insets/insetnomencl.h" #include "insets/insetlabel.h" #include "insets/insetline.h" #include "insets/insetmarginal.h" @@ -87,6 +88,12 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) case LFUN_PAGEBREAK_INSERT: return new InsetPagebreak; + case LFUN_CLEARPAGE_INSERT: + return new InsetClearPage; + + case LFUN_CLEARDOUBLEPAGE_INSERT: + return new InsetClearDoublePage; + case LFUN_CHARSTYLE_INSERT: { string s = cmd.getArg(0); LyXTextClass tclass = params.getLyXTextClass(); @@ -112,9 +119,9 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) } case LFUN_BRANCH_INSERT: { - string arg = cmd.getArg(0); + docstring arg = cmd.argument(); if (arg.empty()) - arg = "none"; + arg = from_ascii("none"); return new InsetBranch(params, InsetBranchParams(arg)); } @@ -166,11 +173,19 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) // Try and generate a valid index entry. InsetCommandParams icp("index"); icp["name"] = cmd.argument().empty() ? - from_utf8(bv->getLyXText()->getStringToIndex(bv->cursor())) : + bv->cursor().innerText()->getStringToIndex(bv->cursor()) : cmd.argument(); return new InsetIndex(icp); } + case LFUN_NOMENCL_INSERT: { + InsetCommandParams icp("nomenclature"); + icp["symbol"] = cmd.argument().empty() ? + bv->cursor().innerText()->getStringToIndex(bv->cursor()) : + cmd.argument(); + return new InsetNomencl(icp); + } + case LFUN_TABULAR_INSERT: { if (cmd.argument().empty()) return 0; @@ -195,6 +210,9 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) case LFUN_INDEX_PRINT: return new InsetPrintIndex(InsetCommandParams("printindex")); + case LFUN_NOMENCL_PRINT: + return new InsetPrintNomencl(InsetCommandParams("printnomenclature")); + case LFUN_TOC_INSERT: return new InsetTOC(InsetCommandParams("tableofcontents")); @@ -264,6 +282,12 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd) icp); return new InsetIndex(icp); + } else if (name == "nomenclature") { + InsetCommandParams icp(name); + InsetCommandMailer::string2params(name, lyx::to_utf8(cmd.argument()), + icp); + return new InsetNomencl(icp); + } else if (name == "label") { InsetCommandParams icp(name); InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), @@ -369,6 +393,8 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf) inset.reset(new InsetBibtex(inscmd)); } else if (cmdName == "index") { inset.reset(new InsetIndex(inscmd)); + } else if (cmdName == "nomenclature") { + inset.reset(new InsetNomencl(inscmd)); } else if (cmdName == "include") { inset.reset(new InsetInclude(inscmd)); } else if (cmdName == "label") { @@ -396,6 +422,8 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf) inset.reset(new InsetFloatList("table")); } else if (cmdName == "printindex") { inset.reset(new InsetPrintIndex(inscmd)); + } else if (cmdName == "printnomenclature") { + inset.reset(new InsetPrintNomencl(inscmd)); } else { lyxerr << "unknown CommandInset '" << cmdName << "'" << std::endl; @@ -432,7 +460,7 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf) inset.reset(new InsetBranch(buf.params(), InsetBranchParams())); } else if (tmptok == "Include") { - InsetCommandParams p("Include"); + InsetCommandParams p("include"); inset.reset(new InsetInclude(p)); } else if (tmptok == "Environment") { lex.next();