]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
At least for now, this has to be done differently.
[lyx.git] / src / LyXRC.cpp
index 6cc8af0ca136958068b8e88d390428e066083c14..b79d4be6e7c1a1b584fa45b8e1c22d9183eac539 100644 (file)
@@ -92,6 +92,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
        { "\\format", LyXRC::RC_FORMAT },
        { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
+       { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
        { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
        { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
        { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
@@ -315,6 +316,7 @@ void LyXRC::setDefaults()
        full_screen_limit = false;
        full_screen_toolbars = true;
        full_screen_tabbar = true;
+       full_screen_menubar = true;
        full_screen_scrollbar = true;
        full_screen_width = 700;
 
@@ -596,7 +598,7 @@ int LyXRC::read(Lexer & lexrc)
 
                case RC_BIBTEX_ALTERNATIVES:
                        if (lexrc.next(true)) {
-                               bibtex_alternatives.push_back(lexrc.getString());
+                               bibtex_alternatives.insert(lexrc.getString());
                        }
                        break;
 
@@ -614,7 +616,7 @@ int LyXRC::read(Lexer & lexrc)
 
                case RC_INDEX_ALTERNATIVES:
                        if (lexrc.next(true)) {
-                               index_alternatives.push_back(lexrc.getString());
+                               index_alternatives.insert(lexrc.getString());
                        }
                        break;
 
@@ -1123,6 +1125,9 @@ int LyXRC::read(Lexer & lexrc)
                case RC_FULL_SCREEN_TABBAR:
                        lexrc >> full_screen_tabbar;
                        break;
+               case RC_FULL_SCREEN_MENUBAR:
+                       lexrc >> full_screen_menubar;
+                       break;
                case RC_FULL_SCREEN_WIDTH:
                        lexrc >> full_screen_width;
                        break;
@@ -1365,15 +1370,18 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
-       case RC_BIBTEX_ALTERNATIVES:
-               if (ignore_system_lyxrc ||
-                   bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
-                       for (vector<string>::const_iterator it = bibtex_alternatives.begin();
-                            it != bibtex_alternatives.end(); ++it)
-                       os << "\\bibtex_alternatives \"" << *it << "\"\n";
+       case RC_BIBTEX_ALTERNATIVES: {
+               set<string>::const_iterator it = bibtex_alternatives.begin();
+               set<string>::const_iterator end = bibtex_alternatives.end();
+               for ( ; it != end; ++it) {
+                       if (ignore_system_lyxrc
+                           || !system_lyxrc.bibtex_alternatives.count(*it))
+                               os << "\\bibtex_alternatives \""
+                                  << *it << "\"\n";
                }
                if (tag != RC_LAST)
                        break;
+       }
        case RC_BIBTEX_COMMAND:
                if (ignore_system_lyxrc ||
                    bibtex_command != system_lyxrc.bibtex_command) {
@@ -1388,15 +1396,18 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
-       case RC_INDEX_ALTERNATIVES:
-               if (ignore_system_lyxrc ||
-                   index_alternatives != system_lyxrc.index_alternatives) {
-                       for (vector<string>::const_iterator it = index_alternatives.begin();
-                            it != index_alternatives.end(); ++it)
-                       os << "\\index_alternatives \"" << *it << "\"\n";
+       case RC_INDEX_ALTERNATIVES: {
+               set<string>::const_iterator it = index_alternatives.begin();
+               set<string>::const_iterator end = index_alternatives.end();
+               for ( ; it != end; ++it) {
+                       if (ignore_system_lyxrc
+                           || !system_lyxrc.index_alternatives.count(*it))
+                               os << "\\index_alternatives \""
+                                  << *it << "\"\n";
                }
                if (tag != RC_LAST)
                        break;
+       }
        case RC_INDEX_COMMAND:
                if (ignore_system_lyxrc ||
                    index_command != system_lyxrc.index_command) {
@@ -1771,6 +1782,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
+       case RC_FULL_SCREEN_MENUBAR:
+               if (ignore_system_lyxrc ||
+                   full_screen_menubar != system_lyxrc.full_screen_menubar) {
+                       os << "\\fullscreen_menubar "
+                          << convert<string>(full_screen_menubar)
+                          << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_FULL_SCREEN_WIDTH:
                if (ignore_system_lyxrc ||
                    full_screen_width != system_lyxrc.full_screen_width) {