]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
tex2lyx/text.cpp: whitespace fix
[lyx.git] / src / factory.cpp
index d763e52f5becb22227881dd8c4b3e52e61f41672..f17b91dd49c6a81dc95b94a5225b232e6c3fe382 100644 (file)
@@ -38,6 +38,7 @@
 #include "insets/InsetInclude.h"
 #include "insets/InsetIndex.h"
 #include "insets/InsetInfo.h"
+#include "insets/InsetIPA.h"
 #include "insets/InsetLabel.h"
 #include "insets/InsetLine.h"
 #include "insets/InsetMarginal.h"
@@ -145,11 +146,28 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                case LFUN_ARGUMENT_INSERT:
                        return new InsetArgument(buf);
 
-               case LFUN_FLOAT_INSERT:
-                       return new InsetFloat(buf, to_utf8(cmd.argument()));
+               case LFUN_FLOAT_INSERT: {
+                       string argument = to_utf8(cmd.argument());
+                       if (!argument.empty()) {
+                               if (!contains(argument, "sideways")) {
+                                       if (!contains(argument, "wide"))
+                                               argument += "\nwide false";
+                                       argument += "\nsideways false";
+                               }
+                       }
+                       return new InsetFloat(buf, argument);
+               }
 
                case LFUN_FLOAT_WIDE_INSERT: {
-                       InsetFloat * fl = new InsetFloat(buf, to_utf8(cmd.argument()));
+                       string argument = to_utf8(cmd.argument());
+                       if (!argument.empty()) {
+                               if (!contains(argument, "sideways")) {
+                                       if (!contains(argument, "wide"))
+                                               argument += "\nwide true";
+                                       argument += "\nsideways false";
+                               }
+                       }
+                       InsetFloat * fl = new InsetFloat(buf, argument);
                        fl->setWide(true);
                        return fl;
                }
@@ -167,6 +185,9 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                        return new InsetIndex(buf, InsetIndexParams(arg));
                }
 
+               case LFUN_IPA_INSERT:
+                       return new InsetIPA(buf);
+
                case LFUN_NOMENCL_INSERT: {
                        InsetCommandParams icp(NOMENCL_CODE);
                        icp["symbol"] = cmd.argument();
@@ -210,6 +231,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                case LFUN_PREVIEW_INSERT:
                        return new InsetPreview(buf);
 
+               case LFUN_SCRIPT_INSERT: {
+                       InsetScriptParams isp;
+                       InsetScript::string2params("script script " + to_utf8(cmd.argument()), isp);
+                       return new InsetScript(buf, isp);
+               }
+
                case LFUN_INSET_INSERT: {
                        string const name = cmd.getArg(0);
                        InsetCode code = insetCode(name);
@@ -359,6 +386,8 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                                isp.kind = InsetSpaceParams::NORMAL;
                        else if (name == "protected")
                                isp.kind = InsetSpaceParams::PROTECTED;
+                       else if (name == "visible")
+                               isp.kind = InsetSpaceParams::VISIBLE;
                        else if (name == "thin")
                                isp.kind = InsetSpaceParams::THIN;
                        else if (isp.math && name == "med")
@@ -375,9 +404,9 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd)
                                isp.kind = InsetSpaceParams::ENSKIP;
                        else if (name == "negthinspace")
                                isp.kind = InsetSpaceParams::NEGTHIN;
-                       else if (isp.math && name == "negmedspace")
+                       else if (name == "negmedspace")
                                isp.kind = InsetSpaceParams::NEGMEDIUM;
-                       else if (isp.math && name == "negthickspace")
+                       else if (name == "negthickspace")
                                isp.kind = InsetSpaceParams::NEGTHICK;
                        else if (name == "hfill")
                                isp.kind = InsetSpaceParams::HFILL;
@@ -590,6 +619,8 @@ Inset * readInset(Lexer & lex, Buffer * buf)
                        inset.reset(new InsetFloatList(buf));
                } else if (tmptok == "Info") {
                        inset.reset(new InsetInfo(buf));
+               } else if (tmptok == "IPA") {
+                       inset.reset(new InsetIPA(buf));
                } else if (tmptok == "Preview") {
                        inset.reset(new InsetPreview(buf));
                } else {