]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
* src/tabular.[Ch]: simplify plaintext methods, because there
[lyx.git] / src / factory.C
index e0211221e11223a39858cf0677679343a094785c..19092859965d9c53a562103e3f8a4a8322488d1f 100644 (file)
@@ -37,6 +37,7 @@
 #include "insets/insethfill.h"
 #include "insets/insetinclude.h"
 #include "insets/insetindex.h"
+#include "insets/insetnomencl.h"
 #include "insets/insetlabel.h"
 #include "insets/insetline.h"
 #include "insets/insetmarginal.h"
@@ -87,6 +88,12 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
        case LFUN_PAGEBREAK_INSERT:
                return new InsetPagebreak;
 
+       case LFUN_CLEARPAGE_INSERT:
+               return new InsetClearPage;
+
+       case LFUN_CLEARDOUBLEPAGE_INSERT:
+               return new InsetClearDoublePage;
+
        case LFUN_CHARSTYLE_INSERT: {
                string s = cmd.getArg(0);
                LyXTextClass tclass = params.getLyXTextClass();
@@ -166,11 +173,19 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
                // Try and generate a valid index entry.
                InsetCommandParams icp("index");
                icp["name"] = cmd.argument().empty() ?
-                       bv->getLyXText()->getStringToIndex(bv->cursor()) :
+                       bv->cursor().innerText()->getStringToIndex(bv->cursor()) :
                        cmd.argument();
                return new InsetIndex(icp);
        }
 
+       case LFUN_NOMENCL_INSERT: {
+               InsetCommandParams icp("nomenclature");
+               icp["symbol"] = cmd.argument().empty() ?
+                       bv->cursor().innerText()->getStringToIndex(bv->cursor()) :
+                       cmd.argument();
+               return new InsetNomencl(icp);
+       }
+
        case LFUN_TABULAR_INSERT: {
                if (cmd.argument().empty())
                        return 0;
@@ -195,6 +210,9 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
        case LFUN_INDEX_PRINT:
                return new InsetPrintIndex(InsetCommandParams("printindex"));
 
+       case LFUN_NOMENCL_PRINT:
+               return new InsetPrintNomencl(InsetCommandParams("printnomenclature"));
+
        case LFUN_TOC_INSERT:
                return new InsetTOC(InsetCommandParams("tableofcontents"));
 
@@ -264,6 +282,12 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
                                                          icp);
                        return new InsetIndex(icp);
 
+               } else if (name == "nomenclature") {
+                       InsetCommandParams icp(name);
+                       InsetCommandMailer::string2params(name, lyx::to_utf8(cmd.argument()),
+                                                         icp);
+                       return new InsetNomencl(icp);
+
                } else if (name == "label") {
                        InsetCommandParams icp(name);
                        InsetCommandMailer::string2params(name, to_utf8(cmd.argument()),
@@ -369,6 +393,8 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
                        inset.reset(new InsetBibtex(inscmd));
                } else if (cmdName == "index") {
                        inset.reset(new InsetIndex(inscmd));
+               } else if (cmdName == "nomenclature") {
+                       inset.reset(new InsetNomencl(inscmd));
                } else if (cmdName == "include") {
                        inset.reset(new InsetInclude(inscmd));
                } else if (cmdName == "label") {
@@ -396,6 +422,8 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
                        inset.reset(new InsetFloatList("table"));
                } else if (cmdName == "printindex") {
                        inset.reset(new InsetPrintIndex(inscmd));
+               } else if (cmdName == "printnomenclature") {
+                       inset.reset(new InsetPrintNomencl(inscmd));
                } else {
                        lyxerr << "unknown CommandInset '" << cmdName
                               << "'" << std::endl;
@@ -432,7 +460,7 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf)
                        inset.reset(new InsetBranch(buf.params(),
                                                    InsetBranchParams()));
                } else if (tmptok == "Include") {
-                       InsetCommandParams p("Include");
+                       InsetCommandParams p("include");
                        inset.reset(new InsetInclude(p));
                } else if (tmptok == "Environment") {
                        lex.next();