]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
LogUi.ui: string redundancy.
[lyx.git] / src / LyXRC.cpp
index 993fb3889f29dbbc170a1bc49d549592931e795f..39c1172f923dc3af8d431e84cd90e64c7e268187 100644 (file)
@@ -270,10 +270,6 @@ void LyXRC::setDefaults()
        display_graphics = true;
        // Spellchecker settings:
        spellchecker_accept_compound = false;
-       spellchecker_use_input_encoding = false;
-       spellchecker_use_alt_lang = false;
-       spellchecker_use_pers_dict = false;
-       spellchecker_use_esc_chars = false;
        spellcheck_continuously = false;
        use_kbmap = false;
        rtl_support = true;
@@ -598,7 +594,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 +612,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;
 
@@ -712,11 +708,6 @@ int LyXRC::read(Lexer & lexrc)
                        }
                        break;
 
-               case RC_USETEMPDIR:
-                       if (lexrc.next())
-                               LYXERR0("Ignoring obsolete use_tempdir flag.");
-                       break;
-
                case RC_USELASTFILEPOS:
                        lexrc >> use_lastfilepos;
                        break;
@@ -875,9 +866,6 @@ int LyXRC::read(Lexer & lexrc)
                        lexrc >> dialogs_iconify_with_main;
                        break;
 
-               case RC_PLAINTEXT_ROFF_COMMAND: 
-                       (void) lexrc.getString(); // Obsoleted in 2.0
-                       break;
                case RC_PLAINTEXT_LINELEN:
                        lexrc >> plaintext_linelen;
                        break;
@@ -885,31 +873,15 @@ int LyXRC::read(Lexer & lexrc)
                case RC_ACCEPT_COMPOUND:
                        lexrc >> spellchecker_accept_compound;
                        break;
-               case RC_USE_INP_ENC:
-                       lexrc >> spellchecker_use_input_encoding;
-                       break;
-               case RC_USE_ALT_LANG:
-                       lexrc >> spellchecker_use_alt_lang;
-                       break;
-               case RC_USE_PERS_DICT:
-                       lexrc >> spellchecker_use_pers_dict;
-                       break;
                case RC_USE_TOOLTIP:
                        lexrc >> use_tooltip;
                        break;
                case RC_USE_PIXMAP_CACHE:
                        lexrc >> use_pixmap_cache;
                        break;
-               case RC_USE_ESC_CHARS:
-                       lexrc >> spellchecker_use_esc_chars;
-                       break;
                case RC_ALT_LANG:
                        lexrc >> spellchecker_alt_lang;
                        break;
-               case RC_PERS_DICT:
-                       if (lexrc.next())
-                               spellchecker_pers_dict = os::internal_path(lexrc.getString());
-                       break;
                case RC_ESC_CHARS:
                        lexrc >> spellchecker_esc_chars;
                        break;
@@ -1135,10 +1107,20 @@ int LyXRC::read(Lexer & lexrc)
                        lexrc >> open_buffers_in_tabs;
                        break;
 
+               // Obsoteted in 1.4.0
+               case RC_USETEMPDIR:
                // Obsoleted in 2.0
                case RC_SPELL_COMMAND:
+               case RC_PERS_DICT:
+               case RC_PLAINTEXT_ROFF_COMMAND: 
+               case RC_USE_ALT_LANG:
+               case RC_USE_ESC_CHARS:
+               case RC_USE_INP_ENC:
+               case RC_USE_PERS_DICT:
                case RC_USE_SPELL_LIB:
-                       (void) lexrc.getString();
+                       LYXERR(Debug::LYXRC, "Skipping obsolete tag `" 
+                              << lexrc.getString() << "'.");
+                       lexrc.next(true);
                        break;
 
                case RC_LAST:
@@ -1371,28 +1353,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_BIBTEX_ALTERNATIVES: {
-               vector<string>::const_iterator it = bibtex_alternatives.begin();
-               vector<string>::const_iterator end = bibtex_alternatives.end();
-               if (ignore_system_lyxrc) {
-                       for ( ; it != end; ++it)
+               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";
-               } else {
-                       vector<string>::const_iterator sbeg =
-                               system_lyxrc.bibtex_alternatives.begin();
-                       vector<string>::const_iterator send =
-                               system_lyxrc.bibtex_alternatives.end();
-                       for ( ; it != end; ++it) {
-                               bool found = false;
-                               for (vector<string>::const_iterator sit = sbeg;
-                                                       sit != send; ++sit) {
-                                       if (*it == *sit)
-                                               found = true;
-                               }
-                               if (!found)
-                                       os << "\\bibtex_alternatives \""
-                                          << *it << "\"\n";
-                       }
                }
                if (tag != RC_LAST)
                        break;
@@ -1412,28 +1379,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_INDEX_ALTERNATIVES: {
-               vector<string>::const_iterator it = index_alternatives.begin();
-               vector<string>::const_iterator end = index_alternatives.end();
-               if (ignore_system_lyxrc) {
-                       for ( ; it != end; ++it)
+               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";
-               } else {
-                       vector<string>::const_iterator sbeg =
-                               system_lyxrc.index_alternatives.begin();
-                       vector<string>::const_iterator send =
-                               system_lyxrc.index_alternatives.end();
-                       for ( ; it != end; ++it) {
-                               bool found = false;
-                               for (vector<string>::const_iterator sit = sbeg;
-                                                       sit != send; ++sit) {
-                                       if (*it == *sit)
-                                               found = true;
-                               }
-                               if (!found)
-                                       os << "\\index_alternatives \""
-                                          << *it << "\"\n";
-                       }
                }
                if (tag != RC_LAST)
                        break;
@@ -2236,11 +2188,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_ALT_LANG:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
-                       os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
-                          << '\n';
-               }
+               // Obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_ALT_LANG:
@@ -2252,11 +2200,6 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_ESC_CHARS:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
-                       os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
-                          << '\n';
-               }
                if (tag != RC_LAST)
                        break;
        case RC_ESC_CHARS:
@@ -2267,12 +2210,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        case RC_USE_PERS_DICT:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
-                       os << "\\use_personal_dictionary "
-                          << convert<string>(spellchecker_use_pers_dict)
-                          << '\n';
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_USE_TOOLTIP:
@@ -2282,6 +2220,8 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                           << convert<string>(use_tooltip)
                           << '\n';
                }
+               if (tag != RC_LAST)
+                       break;
        case RC_USE_PIXMAP_CACHE:
                if (ignore_system_lyxrc ||
                    use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
@@ -2289,27 +2229,22 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                           << convert<string>(use_pixmap_cache)
                           << '\n';
                }
+               if (tag != RC_LAST)
+                       break;
        case RC_PERS_DICT:
-               if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
-                       string const path = os::external_path(spellchecker_pers_dict);
-                       os << "\\personal_dictionary \"" << path << "\"\n";
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
        case RC_USE_INP_ENC:
-               if (ignore_system_lyxrc ||
-                   spellchecker_use_input_encoding
-                   != system_lyxrc.spellchecker_use_input_encoding) {
-                       os << "\\use_input_encoding "
-                          << convert<string>(spellchecker_use_input_encoding)
-                          << '\n';
-               }
+               // obsoleted in 2.0
                if (tag != RC_LAST)
                        break;
 
                os << "\n#\n"
                   << "# LANGUAGE SUPPORT SECTION ##########################\n"
                   << "#\n\n";
+               if (tag != RC_LAST)
+                       break;
 
        case RC_SPELLCHECK_CONTINUOUSLY:
                if (ignore_system_lyxrc ||
@@ -2823,11 +2758,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
                         "Use the OS native format.");
                break;
 
-       case RC_PERS_DICT:
-       case RC_USE_PERS_DICT:
-               str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
-               break;
-
        case RC_PREVIEW:
                str = _("Shows a typeset preview of things such as math");
                break;
@@ -2994,10 +2924,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
        case RC_USETEMPDIR:
                break;
 
-       case RC_USE_INP_ENC:
-               str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
-               break;
-
        case RC_USE_TOOLTIP:
                str = _("Enable the automatic appearance of tool tips in the work area.");
                break;