X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=a465a55e86db268b622a9874f81a4bd3d011c943;hb=5be391b274f2cbf4a1da03bc5ee2136cb6c4e660;hp=f255ef2540fbd783b94dda492272874c3c8dd59f;hpb=684d27c0fbae75931586324c061e6a6b456ea632;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index f255ef2540..a465a55e86 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -12,13 +12,9 @@ #include "factory.h" -#include "Buffer.h" -#include "BufferParams.h" -#include "FloatList.h" #include "FuncRequest.h" #include "Lexer.h" #include "LyX.h" -#include "TextClass.h" #include "insets/InsetBibitem.h" #include "insets/InsetBibtex.h" @@ -38,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" @@ -51,6 +48,7 @@ #include "insets/InsetArgument.h" #include "insets/InsetPhantom.h" #include "insets/InsetPreview.h" +#include "insets/InsetQuotes.h" #include "insets/InsetRef.h" #include "insets/InsetScript.h" #include "insets/InsetSeparator.h" @@ -67,7 +65,6 @@ #include "support/debug.h" #include "support/ExceptionMessage.h" -#include "support/lassert.h" #include "support/lstrings.h" #include "support/unique_ptr.h" @@ -99,6 +96,8 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) inp.kind = InsetNewpageParams::CLEARPAGE; else if (name == "cleardoublepage") inp.kind = InsetNewpageParams::CLEARDOUBLEPAGE; + else if (name == "nopagebreak") + inp.kind = InsetNewpageParams::NOPAGEBREAK; return new InsetNewpage(inp); } @@ -161,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); @@ -217,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)); } @@ -343,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)); } @@ -669,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") {