]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
fix some C++ parsing bugs
[lyx.git] / src / factory.C
index 6fbcb377b77c9507ce9adc34cba26a2c4da44833..490bd0dabb73f49ec74d7d56fdcfb6f74a28abe3 100644 (file)
@@ -112,7 +112,7 @@ Inset * createInset(FuncRequest const & cmd)
                // Try and generate a valid index entry.
                InsetCommandParams icp("index");
                string const contents = cmd.argument.empty() ?
-                       bv->getLyXText()->getStringToIndex(bv) :
+                       bv->getLyXText()->getStringToIndex() :
                        cmd.argument;
                icp.setContents(contents);
 
@@ -172,7 +172,7 @@ Inset * createInset(FuncRequest const & cmd)
                return new InsetTheorem;
 #endif
 
-       case LFUN_INSET_APPLY: {
+       case LFUN_INSET_INSERT: {
                string const name = cmd.getArg(0);
 
                if (name == "bibitem") {
@@ -200,14 +200,14 @@ Inset * createInset(FuncRequest const & cmd)
                        return inset;
 
                } else if (name == "external") {
-                       InsetExternal::Params iep;                      
+                       InsetExternal::Params iep;
                        InsetExternalMailer::string2params(cmd.argument, iep);
                        InsetExternal * inset = new InsetExternal;
                        inset->setFromParams(iep);
                        return inset;
 
                } else if (name == "graphics") {
-                       InsetGraphicsParams igp;                        
+                       InsetGraphicsParams igp;
                        InsetGraphicsMailer::string2params(cmd.argument, igp);
                        InsetGraphics * inset = new InsetGraphics;
                        string const fpath = cmd.view()->buffer()->filePath();
@@ -331,6 +331,9 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                } else if (tmptok == "Include") {
                        InsetCommandParams p("Include");
                        inset = new InsetInclude(p, buf);
+               } else if (tmptok == "Environment") {
+                       lex.next();
+                       inset = new InsetEnvironment(buf.params, lex.getString());
                } else if (tmptok == "ERT") {
                        inset = new InsetERT(buf.params);
                } else if (tmptok == "Tabular") {