X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=c49da693105cac8270353242499c3962a369edd3;hb=1797f5218b8819874f9dbe97b44445b3b5d598a0;hp=f3ed84eebb8091afe0ba91e0c17c597fa78f6656;hpb=bd5b4ebd323a0e6999162c3acc41c326bed80042;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index f3ed84eebb..c49da69310 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -64,7 +64,7 @@ #include "support/lstrings.h" #include "support/ExceptionMessage.h" -#include +#include "support/lassert.h" #include @@ -103,7 +103,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd) case LFUN_FLEX_INSERT: { string s = cmd.getArg(0); - return new InsetFlex(buf, buf.params().documentClassPtr(), s); + return new InsetFlex(buf, s); } case LFUN_NOTE_INSERT: { @@ -210,8 +210,11 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd) case LFUN_ENVIRONMENT_INSERT: return new InsetEnvironment(buf, cmd.argument()); - case LFUN_INFO_INSERT: - return new InsetInfo(buf, to_utf8(cmd.argument())); + case LFUN_INFO_INSERT: { + InsetInfo * inset = new InsetInfo(buf, to_utf8(cmd.argument())); + inset->updateInfo(); + return inset; + } case LFUN_INSET_INSERT: { string const name = cmd.getArg(0); @@ -420,8 +423,8 @@ Inset * readInset(Lexer & lex, Buffer const & buf) auto_ptr inset; - lex.next(); - string tmptok = lex.getString(); + string tmptok; + lex >> tmptok; // test the different insets @@ -515,11 +518,9 @@ Inset * readInset(Lexer & lex, Buffer const & buf) } else if (tmptok == "Flex") { lex.next(); string s = lex.getString(); - inset.reset(new InsetFlex(buf, - buf.params().documentClassPtr(), s)); + inset.reset(new InsetFlex(buf, s)); } else if (tmptok == "Branch") { - inset.reset(new InsetBranch(buf, - InsetBranchParams())); + inset.reset(new InsetBranch(buf, InsetBranchParams())); } else if (tmptok == "Environment") { lex.next(); inset.reset(new InsetEnvironment(buf, lex.getDocString()));