X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=2ffa85018c1666ab32b1a8b57d688aec03ed2433;hb=4db3e641ed6765e005343010cb90ee8af26f8f99;hp=e25a2630490b1598042ec1c890f750d24ed2bae1;hpb=6b2232a29c682d8e62d1d2b963bb1a70bee4330b;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index e25a263049..2ffa85018c 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -154,8 +154,14 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case LFUN_MARGINALNOTE_INSERT: return new InsetMarginal(buf); - case LFUN_ARGUMENT_INSERT: - return new InsetArgument(buf); + case LFUN_ARGUMENT_INSERT: { + string arg = cmd.getArg(0); + if (arg.empty()) { + LYXERR0("argument-insert needs an argument!"); + return 0; + } + return new InsetArgument(buf, arg); + } case LFUN_FLOAT_INSERT: { string argument = to_utf8(cmd.argument()); @@ -218,8 +224,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) return new InsetTabular(buf, r, c); } - case LFUN_CAPTION_INSERT: - return new InsetCaption(buf); + case LFUN_CAPTION_INSERT: { + string arg = cmd.getArg(0); + if (arg.empty()) + arg = "Standard"; + return new InsetCaption(buf, arg); + } case LFUN_INDEX_PRINT: { InsetCommandParams icp(INDEX_PRINT_CODE); @@ -618,7 +628,7 @@ Inset * readInset(Lexer & lex, Buffer * buf) } else if (tmptok == "Newline") { inset.reset(new InsetNewline); } else if (tmptok == "Argument") { - inset.reset(new InsetArgument(buf)); + inset.reset(new InsetArgument(buf, tmptok)); } else if (tmptok == "Float") { inset.reset(new InsetFloat(buf, string())); } else if (tmptok == "Wrap") { @@ -626,7 +636,9 @@ Inset * readInset(Lexer & lex, Buffer * buf) string tmptok = lex.getString(); inset.reset(new InsetWrap(buf, tmptok)); } else if (tmptok == "Caption") { - inset.reset(new InsetCaption(buf)); + lex.eatLine(); + string s = lex.getString(); + inset.reset(new InsetCaption(buf, s)); } else if (tmptok == "Index") { inset.reset(new InsetIndex(buf, InsetIndexParams())); } else if (tmptok == "FloatList") {