]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Routines to retrieve HTML style information.
[lyx.git] / src / LyXRC.cpp
index 401aa9546d121217b288242248047143477cc5c8..b79d4be6e7c1a1b584fa45b8e1c22d9183eac539 100644 (file)
@@ -598,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;
 
@@ -616,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;
 
@@ -1370,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) {
@@ -1393,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) {