]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
Alfredo's second patch
[lyx.git] / src / factory.C
index 24cd050bfd7e938982e965e466888543cb7ce3d0..0e88c5f7a845f6157d0437f599e27451b72d7d5b 100644 (file)
@@ -23,6 +23,7 @@
 #include "insets/insetbibtex.h"
 #include "insets/insetcaption.h"
 #include "insets/insetcite.h"
+#include "insets/insetenv.h"
 #include "insets/insetert.h"
 #include "insets/insetexternal.h"
 #include "insets/insetfloat.h"
@@ -111,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);
 
@@ -160,6 +161,9 @@ Inset * createInset(FuncRequest const & cmd)
                return new InsetParent(
                        InsetCommandParams("lyxparent", cmd.argument), *bv->buffer());
 
+       case LFUN_ENVIRONMENT_INSERT:
+               return new InsetEnvironment(params, cmd.argument);
+
 #if 0
        case LFUN_INSET_LIST:
                return new InsetList;
@@ -168,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") {
@@ -196,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();
@@ -290,6 +294,7 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                           || cmdName == "htmlurl") {
                        inset = new InsetUrl(inscmd);
                } else if (cmdName == "ref"
+                          || cmdName == "eqref"
                           || cmdName == "pageref"
                           || cmdName == "vref"
                           || cmdName == "vpageref"
@@ -327,6 +332,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") {