]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarDefaults.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / ToolbarDefaults.C
index 9e8cc03a780656abc5f622fa2d3e18f765a0a28e..a51b9ff984daf43b4642ec5981a11148ec181154 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.
  *
  *
  * ====================================================== */
@@ -64,15 +64,14 @@ void ToolbarDefaults::init()
        add(LFUN_DEPTH);
        add(SEPARATOR);
 
+#ifndef NO_LATEX
        add(LFUN_TEX);
+#endif
         add(LFUN_MATH_MODE);
        add(SEPARATOR);
 
        add(LFUN_FIGURE);
        add(LFUN_DIALOG_TABULAR_INSERT);
-#if 0
-       //add(LFUN_MELT);
-#endif
 }
 
 
@@ -111,14 +110,13 @@ void ToolbarDefaults::read(LyXLex & lex)
 
        if (lyxerr.debugging(Debug::PARSER))
                lex.printTable(lyxerr);
-       
-       while (lex.IsOK() && !quit) {
 
+       while (lex.IsOK() && !quit) {
                switch (lex.lex()) {
                case TO_ADD:
                        if (lex.next()) {
                                func = lex.GetString();
-                               lyxerr[Debug::GUI]
+                               lyxerr[Debug::PARSER]
                                        << "Toolbar::read TO_ADD func: `"
                                        << func << "'" << endl;
                                add(func);
@@ -149,7 +147,6 @@ void ToolbarDefaults::read(LyXLex & lex)
                }
        }
        lex.popTable();
-       lex.next();
 }
 
 
@@ -158,8 +155,8 @@ void ToolbarDefaults::add(string const & 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);
        }