]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
List currently used shortcuts in the shortcuts panel of the preference dialog
[lyx.git] / src / factory.cpp
index 278b64fb383826fa9a5172fff863c982e4faf0cb..cc188a6558819fecc271668d7f0cf27ad1d7155f 100644 (file)
@@ -52,7 +52,7 @@
 #include "insets/InsetSpace.h"
 #include "insets/InsetTabular.h"
 #include "insets/InsetTOC.h"
-#include "insets/InsetUrl.h"
+#include "insets/InsetHyperlink.h"
 #include "insets/InsetVSpace.h"
 #include "insets/InsetWrap.h"
 
@@ -225,9 +225,6 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                case LFUN_INFO_INSERT:
                        return new InsetInfo(params, to_utf8(cmd.argument()));
 #if 0
-               case LFUN_LIST_INSERT:
-                       return new InsetList;
-
                case LFUN_THEOREM_INSERT:
                        return new InsetTheorem;
 #endif
@@ -281,6 +278,12 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                inset->setParams(igp);
                                return inset.release();
 
+                       } else if (name == "href") {
+                               InsetCommandParams icp(name);
+                               InsetCommandMailer::string2params(name, to_utf8(cmd.argument()),
+                                       icp);
+                               return new InsetHyperlink(icp);
+
                        } else if (name == "include") {
                                InsetCommandParams iip(name);
                                InsetIncludeMailer::string2params(to_utf8(cmd.argument()), iip);
@@ -313,12 +316,6 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                        icp);
                                return new InsetTOC(icp);
 
-                       } else if (name == "url") {
-                               InsetCommandParams icp(name);
-                               InsetCommandMailer::string2params(name, to_utf8(cmd.argument()),
-                                       icp);
-                               return new InsetUrl(icp);
-
                        } else if (name == "vspace") {
                                VSpace vspace;
                                InsetVSpaceMailer::string2params(to_utf8(cmd.argument()), vspace);
@@ -393,8 +390,8 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                lex.pushToken(insetType);
 
                //FIXME 
-               //Inset::Code const code = Inset::translate(insetType);
-               //if (code == Inset::NO_CODE) { choke as below; }
+               //InsetCode const code = Inset::translate(insetType);
+               //if (code == NO_CODE) { choke as below; }
                //InsetCommandParams inscmd();
                InsetCommandParams inscmd(insetType);
                inscmd.read(lex);
@@ -407,14 +404,14 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                        inset.reset(new InsetBibtex(inscmd));
                } else if (insetType == "index") {
                        inset.reset(new InsetIndex(buf.params()));
-               } else if (insetType == "nomenclature") {
-                       inset.reset(new InsetNomencl(inscmd));
+               } else if (insetType == "href") {
+                       inset.reset(new InsetHyperlink(inscmd));
                } else if (insetType == "include") {
                        inset.reset(new InsetInclude(inscmd));
                } else if (insetType == "label") {
                        inset.reset(new InsetLabel(inscmd));
-               } else if (insetType == "url") {
-                       inset.reset(new InsetUrl(inscmd));
+               } else if (insetType == "nomenclature") {
+                       inset.reset(new InsetNomencl(inscmd));
                } else if (insetType == "ref") {
                        if (!inscmd["name"].empty()
                            || !inscmd["reference"].empty()) {
@@ -489,8 +486,6 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                        string tmptok = lex.getString();
                        inset.reset(new InsetWrap(buf.params(), tmptok));
 #if 0
-               } else if (tmptok == "List") {
-                       inset.reset(new InsetList);
                } else if (tmptok == "Theorem") {
                        inset.reset(new InsetList);
 #endif
@@ -513,7 +508,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                inset->read(buf, lex);
 
 // FIXME: hack..
-               if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
+               if (inset->lyxCode() == MATHMACRO_CODE) {
                        MathMacroTemplate const * tmpl =
                                static_cast<MathMacroTemplate*>(inset.get());
                        MacroTable::globalMacros().insert