]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
endl is defined in ostream, iomanip is not enough (it matters for gcc 4.3)
[lyx.git] / src / factory.cpp
index 609abcf7937d12877ce4dd3a40fcad395292da7b..c49da693105cac8270353242499c3962a369edd3 100644 (file)
@@ -64,7 +64,7 @@
 #include "support/lstrings.h"
 #include "support/ExceptionMessage.h"
 
-#include <boost/assert.hpp>
+#include "support/lassert.h"
 
 #include <sstream>
 
@@ -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);
@@ -240,9 +243,8 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        }
                        
                        case ERT_CODE: {
-                               InsetCollapsable::CollapseStatus st;
-                               InsetERT::string2params(to_utf8(cmd.argument()), st);
-                               return new InsetERT(buf, st);
+                               return new InsetERT(buf,
+                                       InsetERT::string2params(to_utf8(cmd.argument())));
                        }
                                
                        case LISTINGS_CODE: {
@@ -421,8 +423,8 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
 
        auto_ptr<Inset> inset;
 
-       lex.next();
-       string tmptok = lex.getString();
+       string tmptok;
+       lex >> tmptok;
 
        // test the different insets
        
@@ -476,8 +478,9 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                                inset.reset(new InsetPrintNomencl(inscmd));
                                break;
                        case REF_CODE:
-                               if (!inscmd["name"].empty() || !inscmd["reference"].empty())
-                                       inset.reset(new InsetRef(buf, inscmd));
+                               if (inscmd["name"].empty() && inscmd["reference"].empty())
+                                       return 0;
+                               inset.reset(new InsetRef(buf, inscmd));
                                break;
                        case TOC_CODE:
                                inset.reset(new InsetTOC(inscmd));
@@ -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()));