]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
Update my email and status.
[lyx.git] / src / factory.cpp
index e25a2630490b1598042ec1c890f750d24ed2bae1..2ffa85018c1666ab32b1a8b57d688aec03ed2433 100644 (file)
@@ -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") {