]> git.lyx.org Git - lyx.git/blobdiff - src/LyXAction.C
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / LyXAction.C
index ddc2c5278d35a1e60ce412e669f570811059e087..b0c3e705bb5de03e220f42473c079f3656a586e7 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -62,7 +62,7 @@ void LyXAction::init()
        // occupies after the init is completed. It compiles several
        // magnitudes faster.
        
-       static bool init = false;
+       static bool init;
        if (init) return;
 
        struct lfun_item {
@@ -153,6 +153,7 @@ void LyXAction::init()
                  ReadOnly },
                { LFUN_CITATION_CREATE, "citation-insert",
                  N_("Insert citation"), Noop },
+               { LFUN_CITATION_INSERT, "", "internal only", Noop },
                { LFUN_EXEC_COMMAND, "command-execute", "", NoBuffer },
                { LFUN_PREFIX, "command-prefix",
                  N_("Execute command"), NoBuffer },
@@ -195,7 +196,9 @@ void LyXAction::init()
                { LFUN_FILE_OPEN, "file-open", _("Open a file"), NoBuffer },
                { LFUN_MENUSEARCH, "find-replace", N_("Find & Replace"),
                  ReadOnly },
-               { LFUN_INSET_FLOAT, "float-insert", "", Noop },
+               { LFUN_INSET_FLOAT, "float-insert", "Insert a Float", Noop },
+               { LFUN_INSET_WIDE_FLOAT, "float-wide-insert",
+                 "Insert a wide Float", Noop },
                { LFUN_BOLD, "font-bold", N_("Toggle bold"), Noop },
                { LFUN_CODE, "font-code", N_("Toggle code style"), Noop },
                { LFUN_DEFAULT, "font-default", N_("Default font style"),
@@ -218,18 +221,13 @@ void LyXAction::init()
                  ReadOnly },
                { LFUN_HFILL, "hfill-insert",
                  N_("Insert horizontal fill"), Noop },
-               { LFUN_HELP_COPYRIGHT, "help-copyright",
-                 N_("Display copyright information"), NoBuffer },
-               { LFUN_HELP_CREDITS, "help-credits",
-                 N_("Show the list of people who helped writing LyX"), 
-                 NoBuffer},
                { LFUN_HELP_OPEN, "help-open", N_("Open a Help file"), 
                  NoBuffer|Argument},
-               { LFUN_HELP_VERSION, "help-version",
-                 N_("Show the actual LyX version"), NoBuffer},
                { LFUN_HTMLURL, "html-insert", "", Noop },
                { LFUN_HYPHENATION, "hyphenation-point-insert",
                  N_("Insert hyphenation point"), Noop },
+               { LFUN_LIGATURE_BREAK, "ligature-break-insert",
+                 N_("Insert ligature break"), Noop },
                { LFUN_INDEX_CREATE, "index-insert",
                  N_("Insert index item"), Noop },
                { LFUN_INDEX_INSERT_LAST, "index-insert-last",
@@ -254,7 +252,7 @@ void LyXAction::init()
                { LFUN_LAYOUT_COPY, "layout-copy",
                  N_("Copy paragraph environment type"), Noop },
                { LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly },
-               { LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only
+               { LFUN_LAYOUTNO, "", "internal only", Noop },
                { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly },
                { LFUN_LAYOUT_PASTE, "layout-paste",
                  N_("Paste paragraph environment type"), Noop },
@@ -271,7 +269,9 @@ void LyXAction::init()
                { LFUN_END, "line-end", N_("Go to end of line"), ReadOnly },
                { LFUN_ENDSEL, "line-end-select",
                  N_("Select to end of line"), ReadOnly },
+#if 0
                { LFUN_INSET_LIST, "list-insert", "", Noop },
+#endif
                { LFUN_QUIT, "lyx-quit", N_("Exit"), NoBuffer },
                { LFUN_INSET_MARGINAL, "marginalnote-insert",
                  N_("Insert Marginalnote"), Noop },
@@ -286,12 +286,21 @@ void LyXAction::init()
                  N_("Insert math symbol"), Noop },
                { LFUN_MATH_LIMITS, "math-limits", "", Noop },
                { LFUN_MATH_MACRO, "math-macro", "", Noop },
+               { LFUN_MATH_MUTATE, "math-mutate", "", Noop },
+               { LFUN_MATH_SPACE, "math-space", "", Noop },
+               { LFUN_MATH_IMPORT_SELECTION, "math-import-selection", "", Noop },
                { LFUN_MATH_MACROARG, "math-macro-arg", "", Noop },
                { LFUN_INSERT_MATRIX, "math-matrix", "", Noop },
                { LFUN_MATH_MODE, "math-mode", N_("Math mode"), Noop },
                { LFUN_MATH_NONUMBER, "math-nonumber", "", Noop },
                { LFUN_MATH_NUMBER, "math-number", "", Noop },
                { LFUN_MATH_EXTERN, "math-extern", "", Noop },
+               { LFUN_MATH_VALIGN, "math-valign", "", Noop },
+               { LFUN_MATH_HALIGN, "math-halign", "", Noop },
+               { LFUN_MATH_ROW_INSERT, "math-row-insert", "", Noop },
+               { LFUN_MATH_ROW_DELETE, "math-row-delete", "", Noop },
+               { LFUN_MATH_COLUMN_INSERT, "math-column-insert", "", Noop },
+               { LFUN_MATH_COLUMN_DELETE, "math-column-delete", "", Noop },
                { LFUN_MATH_PANEL, "math-panel", "", Noop },
                { LFUN_MATH_SIZE, "math-size", "", Noop },
                { LFUN_MENU_OPEN_BY_NAME, "menu-open", "", NoBuffer },
@@ -300,7 +309,8 @@ void LyXAction::init()
                { LFUN_INSET_MINIPAGE, "minipage-insert", "", Noop },
                { LFUN_INSERT_NOTE, "note-insert", "", Noop },
                { LFUN_GOTONOTE, "note-next", "", ReadOnly },
-               { LFUN_OPENSTUFF, "open-stuff", "", ReadOnly },
+               { LFUN_INSET_TOGGLE, "inset-toggle", 
+                 N_("toggle inset"), ReadOnly },
                { LFUN_DOWN_PARAGRAPH, "paragraph-down",
                  N_("Go one paragraph down"), ReadOnly },
                { LFUN_DOWN_PARAGRAPHSEL, "paragraph-down-select",
@@ -341,7 +351,6 @@ void LyXAction::init()
                { LFUN_SELFINSERT, "self-insert", "", Noop },
                { LFUN_CHARATCURSOR, "server-char-after", "", ReadOnly },
                { LFUN_GETFONT, "server-get-font", "", ReadOnly },
-               { LFUN_GETLATEX, "server-get-latex", "", ReadOnly },
                { LFUN_GETLAYOUT, "server-get-layout", "", ReadOnly },
                { LFUN_GETNAME, "server-get-name", "", ReadOnly },
                { LFUN_GETTIP, "server-get-tip", "", ReadOnly },
@@ -360,10 +369,12 @@ void LyXAction::init()
                  N_("Tabular Features"), Noop },
                { LFUN_INSET_TABULAR, "tabular-insert",
                  N_("Insert a new Tabular Inset"), Noop },
-               { LFUN_TEX, "tex-mode", N_("Toggle TeX style"), Noop },
                { LFUN_INSET_TEXT, "text-insert",
                  N_("Insert a new Text Inset"), Noop },
+#if 0
                { LFUN_INSET_THEOREM, "theorem-insert", "", Noop },
+#endif
+               { LFUN_THESAURUS_ENTRY, "thesaurus-entry", N_("Open thesaurus"), ReadOnly },
                { LFUN_TOC_INSERT, "toc-insert",
                  N_("Insert table of contents"), Noop },
                { LFUN_TOCVIEW, "toc-view",
@@ -377,7 +388,7 @@ void LyXAction::init()
                { LFUN_UP, "up", "", ReadOnly },
                { LFUN_UPSEL, "up-select", "", ReadOnly },
                { LFUN_URL, "url-insert", "", Noop },
-               { LFUN_INSERT_URL, "", "", Noop },
+               { LFUN_INSERT_URL, "", "internal only", Noop },
                { LFUN_VC_CHECKIN, "vc-check-in", "", ReadOnly },
                { LFUN_VC_CHECKOUT, "vc-check-out", "", ReadOnly },
                { LFUN_VC_HISTORY, "vc-history", "", ReadOnly },
@@ -408,6 +419,8 @@ void LyXAction::init()
                { LFUN_TRANSPOSE_CHARS, "chars-transpose", "", Noop },
                { LFUN_FLOAT_LIST, "float-list", "Insert a float list", Noop },
                { LFUN_ESCAPE, "escape", "", Noop },
+               { LFUN_HELP_ABOUTLYX, "help-aboutlyx",
+                 N_("Display information about LyX"), NoBuffer },
                { LFUN_NOACTION, "", "", Noop }
        };
 
@@ -444,9 +457,9 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const
                return LFUN_UNKNOWN_ACTION;
        }
 
-       arg_item::const_iterator aci = (*pit).second.find(arg);
+       arg_item::const_iterator aci = pit->second.find(arg);
 
-       if (aci == (*pit).second.end()) {
+       if (aci == pit->second.end()) {
                // the action does not have any pseudoactions with this arg
                lyxerr[Debug::ACTION] 
                        << "Action " << action
@@ -458,9 +471,9 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const
        // pseudo action exist
        lyxerr[Debug::ACTION] << "Pseudoaction exist[" 
                              << action << '|' 
-                             << arg << "] = " << (*aci).second << endl;
+                             << arg << "] = " << aci->second << endl;
 
-       return (*aci).second;
+       return aci->second;
 }
 
 
@@ -484,7 +497,7 @@ int LyXAction::getPseudoAction(kb_action action, string const & arg) const
        // get the arg_item map
        arg_map::iterator ami = lyx_arg_map.find(action);
        // put the new pseudo function in it
-       (*ami).second[arg] = pseudo_counter;
+       ami->second[arg] = pseudo_counter;
 
        lyxerr[Debug::ACTION] << "Creating new pseudoaction "
                              << pseudo_counter << " for [" << action
@@ -504,10 +517,10 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const
 
        if (pit != lyx_pseudo_map.end()) {
                lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
-                                     << (*pit).second.action << '|'
-                                     << (*pit).second.arg << '\n';
-               arg = (*pit).second.arg;
-               return (*pit).second.action;
+                                     << pit->second.action << '|'
+                                     << pit->second.arg << '\n';
+               arg = pit->second.arg;
+               return pit->second.action;
        } else {
                lyxerr << "Lyx Error: Unrecognized pseudo-action\n";
                return LFUN_UNKNOWN_ACTION;
@@ -530,10 +543,10 @@ int LyXAction::LookupFunc(string const & func) const
 
        if (!argstr.empty() && fit != lyx_func_map.end()) {
                // might be pseudo (or create one)
-               return getPseudoAction((*fit).second, argstr);
+               return getPseudoAction(fit->second, argstr);
        }
 
-       return fit != lyx_func_map.end() ? (*fit).second : LFUN_UNKNOWN_ACTION;
+       return fit != lyx_func_map.end() ? fit->second : LFUN_UNKNOWN_ACTION;
 }
 
 
@@ -558,14 +571,14 @@ int LyXAction::getApproxFunc(string const & func) const
                        lyx_func_map.lower_bound(func);
                
                if (fit != lyx_func_map.end()) {
-                       action =  (*fit).second;
+                       action =  fit->second;
                }
        } else {  // Go get the next function
                func_map::const_iterator fit = 
                        lyx_func_map.upper_bound(func);
                
                if (fit != lyx_func_map.end()) {
-                       action =  (*fit).second;
+                       action =  fit->second;
                }
        }
        
@@ -594,7 +607,7 @@ string const LyXAction::getActionName(int action) const
        info_map::const_iterator iit = lyx_info_map.find(ac);
 
        if (iit != lyx_info_map.end()) {
-               string ret((*iit).second.name);
+               string ret(iit->second.name);
                ret += arg;
                return ret;
        } else 
@@ -619,15 +632,15 @@ string const LyXAction::helpText(int pseudoaction) const
                if (lyxerr.debugging(Debug::ACTION)) {
                        lyxerr << "Action: " << action << '\n';
                        lyxerr << "   name: "
-                              << (*ici).second.name << '\n';
+                              << ici->second.name << '\n';
                        lyxerr << " attrib: "
-                              << (*ici).second.attrib << '\n';
+                              << ici->second.attrib << '\n';
                        lyxerr << "   help: "
-                              << (*ici).second.helpText << '\n';
+                              << ici->second.helpText << '\n';
                }
-               help = (*ici).second.helpText;
+               help = ici->second.helpText;
                // if the is no help text use the name of the func instead.
-               if (help.empty()) help = (*ici).second.name;
+               if (help.empty()) help = ici->second.name;
        }
 
        if (help.empty()) {
@@ -647,7 +660,7 @@ bool LyXAction::funcHasFlag(kb_action action,
        info_map::const_iterator ici = lyx_info_map.find(action);
 
        if (ici != lyx_info_map.end()) {
-               return (*ici).second.attrib & flag;
+               return ici->second.attrib & flag;
        } else {
                // it really should exist, but...
                lyxerr << "LyXAction::funcHasFlag: "