X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=a465a55e86db268b622a9874f81a4bd3d011c943;hb=31a197d88c5521a3ff566597d22b7877d3e151c2;hp=dd72fe33d15359487ad22be478ebd9292331463d;hpb=196d9caeb0b9f74d02750f774de1ca63a483803f;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index dd72fe33d1..a465a55e86 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -34,6 +34,7 @@ #include "insets/InsetHyperlink.h" #include "insets/InsetInclude.h" #include "insets/InsetIndex.h" +#include "insets/InsetIndexMacro.cpp" #include "insets/InsetInfo.h" #include "insets/InsetIPA.h" #include "insets/InsetIPAMacro.h" @@ -159,6 +160,16 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) return new InsetIPADeco(buf, arg2); } + case LFUN_INDEXMACRO_INSERT: { + string const arg = cmd.getArg(0); + if (arg != "see" && arg != "seealso" + && arg != "subentry" && arg != "sortkey") { + LYXERR0("LFUN_INDEXMACRO_INSERT: wrong argument"); + return nullptr; + } + return new InsetIndexMacro(buf, arg); + } + case LFUN_ERT_INSERT: return new InsetERT(buf); @@ -215,7 +226,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) } case LFUN_INDEX_INSERT: { - docstring arg = cmd.argument(); + docstring const & arg = cmd.argument(); return new InsetIndex(buf, InsetIndexParams(arg)); } @@ -341,7 +352,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) } case INDEX_CODE: { - docstring arg = cmd.argument(); + docstring const & arg = cmd.argument(); return new InsetIndex(buf, InsetIndexParams(arg)); } @@ -667,6 +678,9 @@ Inset * readInset(Lexer & lex, Buffer * buf) inset.reset(new InsetCaption(buf, s)); } else if (tmptok == "Index") { inset.reset(new InsetIndex(buf, InsetIndexParams())); + } else if (tmptok == "IndexMacro") { + string s = lex.getString(); + inset.reset(new InsetIndexMacro(buf, s)); } else if (tmptok == "FloatList") { inset.reset(new InsetFloatList(buf)); } else if (tmptok == "Info") {