]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarDefaults.C
bug 183
[lyx.git] / src / ToolbarDefaults.C
index d437d54d42732d87ba802ea942a6b615be20f70d..b81d79bd846f65639770848357ac6bd1861d4d58 100644 (file)
@@ -27,6 +27,28 @@ using std::endl;
 extern LyXAction lyxaction;
 ToolbarDefaults toolbardefaults;
 
+namespace {
+
+enum _tooltags {
+       TO_ADD = 1,
+       TO_ENDTOOLBAR,
+       TO_SEPARATOR,
+       TO_LAYOUTS,
+       TO_NEWLINE,
+       TO_LAST
+};
+
+
+struct keyword_item toolTags[TO_LAST - 1] = {
+       { "end", TO_ENDTOOLBAR },
+       { "icon", TO_ADD },
+       { "layouts", TO_LAYOUTS },
+       { "newline", TO_NEWLINE },
+       { "separator", TO_SEPARATOR }
+};
+
+}; // end of anon namespace
+
 
 ToolbarDefaults::ToolbarDefaults()
 {
@@ -73,35 +95,16 @@ void ToolbarDefaults::init()
 }
 
 
-enum _tooltags {
-       TO_ADD = 1,
-       TO_ENDTOOLBAR,
-        TO_SEPARATOR,
-        TO_LAYOUTS,
-        TO_NEWLINE,
-       TO_LAST
-};
-
-
-struct keyword_item toolTags[TO_LAST - 1] = {
-       { "end", TO_ENDTOOLBAR },
-       { "icon", TO_ADD },
-        { "layouts", TO_LAYOUTS },
-        { "newline", TO_NEWLINE },
-        { "separator", TO_SEPARATOR }
-};
-
-
 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);
@@ -109,11 +112,11 @@ 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(true)) {
-                               func = lex.GetString();
+                               string const func = lex.getString();
                                lyxerr[Debug::PARSER]
                                        << "Toolbar::read TO_ADD func: `"
                                        << func << "'" << endl;
@@ -134,8 +137,6 @@ void ToolbarDefaults::read(LyXLex & lex)
                        break;
                        
                case TO_ENDTOOLBAR:
-                       // should not set automatically
-                       //set();
                        quit = true;
                        break;
                default: