]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarDefaults.C
Fix working of the spellchecker dialog with ispell when there are no
[lyx.git] / src / ToolbarDefaults.C
index 7b98891ee67c301370afb2c09950bc455b35b3dd..83a45ce48c41b7dd9a5ed6d05ef296ed070c3dd8 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.
  *
  *
  * ====================================================== */
 #include "lyxlex.h"
 #include "debug.h"
 #include "lyxlex.h"
-#if 1
-// only until we don't need access to the NEW_INSETS or NEW_TABULAR anymore
-#include "lyxparagraph.h"
-#endif
+#include "support/lstrings.h"
 
 using std::endl;
 
 extern LyXAction lyxaction;
 ToolbarDefaults toolbardefaults;
 
+
 ToolbarDefaults::ToolbarDefaults()
 {
        init();
@@ -41,10 +39,11 @@ void ToolbarDefaults::add(int action)
        defaults.push_back(action);
 }
 
+
 void ToolbarDefaults::init() 
 {
        add(LAYOUTS);
-       add(LFUN_MENUOPEN);
+       add(LFUN_FILE_OPEN);
        //add(LFUN_CLOSEBUFFER);
        add(LFUN_MENUWRITE);
        add(LFUN_MENUPRINT);
@@ -60,23 +59,17 @@ void ToolbarDefaults::init()
        add(LFUN_FREE);
        add(SEPARATOR);
        
-#ifndef NEW_INSETS     
-       add(LFUN_FOOTMELT);
-       add(LFUN_MARGINMELT);
-#else
        add(LFUN_INSET_FOOTNOTE);
        add(LFUN_INSET_MARGINAL);
-#endif
+
        add(LFUN_DEPTH);
        add(SEPARATOR);
 
-       add(LFUN_TEX);
         add(LFUN_MATH_MODE);
        add(SEPARATOR);
 
        add(LFUN_FIGURE);
        add(LFUN_DIALOG_TABULAR_INSERT);
-       //add(LFUN_MELT);
 }
 
 
@@ -102,27 +95,26 @@ struct keyword_item toolTags[TO_LAST - 1] = {
 void ToolbarDefaults::read(LyXLex & lex) 
 {
        //consistency check
-       if (compare_no_case(lex.GetString(), "toolbar"))
+       if (compare_no_case(lex.getString(), "toolbar")) {
                lyxerr << "Toolbar::read: ERROR wrong token:`"
-                      << lex.GetString() << '\'' << endl;
+                      << lex.getString() << '\'' << endl;
+       }
 
        defaults.clear();
        
-       string func;
        bool quit = false;
        
        lex.pushTable(toolTags, TO_LAST - 1);
 
        if (lyxerr.debugging(Debug::PARSER))
                lex.printTable(lyxerr);
-       
-       while (lex.IsOK() && !quit) {
 
-               switch(lex.lex()) {
+       while (lex.isOK() && !quit) {
+               switch (lex.lex()) {
                case TO_ADD:
-                       if (lex.next()) {
-                               func = lex.GetString();
-                               lyxerr[Debug::GUI]
+                       if (lex.next(true)) {
+                               string const func = lex.getString();
+                               lyxerr[Debug::PARSER]
                                        << "Toolbar::read TO_ADD func: `"
                                        << func << "'" << endl;
                                add(func);
@@ -153,17 +145,16 @@ void ToolbarDefaults::read(LyXLex & lex)
                }
        }
        lex.popTable();
-       lex.next();
 }
 
 
 void ToolbarDefaults::add(string const & func)
 {
-       int tf = lyxaction.LookupFunc(func);
+       int const tf = lyxaction.LookupFunc(func);
 
        if (tf == -1) {
-               lyxerr << "Toolbar::add: no LyX command called`"
-                      << func << "'exists!" << endl; 
+               lyxerr << "Toolbar::add: no LyX command called `"
+                      << func << "' exists!" << endl; 
        } else {
                add(tf);
        }