]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
mathed31.diff
[lyx.git] / src / lyxrc.C
index f4caddcd0b627abb4c836a7207553053b7cb29e7..32edd2449a62b3c152de2bb6acfdf7282e54f635 100644 (file)
@@ -68,10 +68,6 @@ keyword_item lyxrcTags[] = {
        { "\\document_path", LyXRC::RC_DOCUMENTPATH },
        { "\\escape_chars", LyXRC::RC_ESC_CHARS },
        { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
-#if 0
-       { "\\fax_command", LyXRC::RC_FAX_COMMAND },
-       { "\\fax_program", LyXRC::RC_FAXPROGRAM },
-#endif
        { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
        { "\\format", LyXRC::RC_FORMAT },
        { "\\input", LyXRC::RC_INPUT },
@@ -91,9 +87,6 @@ keyword_item lyxrcTags[] = {
        { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
        { "\\override_x_deadkeys", LyXRC::RC_OVERRIDE_X_DEADKEYS },
        { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
-#if 0
-       { "\\phone_book", LyXRC::RC_PHONEBOOK },
-#endif
        { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
        { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
        { "\\print_command", LyXRC::RC_PRINT_COMMAND },
@@ -153,6 +146,8 @@ LyXRC::LyXRC()
 
 
 void LyXRC::setDefaults() {
+       bind_file = "cua";
+       hasBindFile = false;
        ui_file = "default";
        // Get printer from the environment. If fail, use default "",
        // assuming that everything is set up correctly.
@@ -202,7 +197,7 @@ void LyXRC::setDefaults() {
        menu_font_name = "-*-helvetica-bold-r";
        popup_font_name = "-*-helvetica-medium-r";
        font_norm = "iso8859-1";
-       font_norm_type = OTHER_ENCODING;
+       font_norm_type = ISO_8859_1;
        font_norm_menu = "";
        override_x_deadkeys = true;
        autosave = 300;
@@ -222,7 +217,6 @@ void LyXRC::setDefaults() {
        isp_use_pers_dict = false;
        isp_use_esc_chars = false;
        use_kbmap = false;
-       hasBindFile = false;
        rtl_support = false;
        auto_number = true;
        mark_foreign_language = true;
@@ -260,12 +254,14 @@ int LyXRC::ReadBindFile(string const & name)
        return result;
 }
 
+void LyXRC::readBindFileIfNeeded()
+{
+       if (!hasBindFile)
+               ReadBindFile(bind_file);
+}
 
 int LyXRC::read(string const & filename)
-{
-       // Default bindfile.
-       static string const bindFile("cua");
-       
+{      
        LyXLex lexrc(lyxrcTags, lyxrcCount);
        if (lyxerr.debugging(Debug::PARSER))
                lexrc.printTable(lyxerr);
@@ -306,13 +302,16 @@ int LyXRC::read(string const & filename)
                case RC_BINDFILE:                     // RVDK_PATCH_5
                        if (lexrc.next()) {
                                string tmp(lexrc.GetString());
-                               if (bind_file.empty()) {
-                                       // we only need the name of the first
-                                       // bind file since that (usually)
-                                       // includes several others.
+                               if (hasBindFile)
+                                       // We are already in the
+                                       // "actually read bind file"
+                                       // mode.
+                                       ReadBindFile(tmp);
+                               else
+                                       // We are still in the "just
+                                       // remember the name of the
+                                       // bind file" mode.
                                        bind_file = tmp;
-                               }
-                               ReadBindFile(tmp);
                        }
                        break;
                        
@@ -678,10 +677,8 @@ int LyXRC::read(string const & filename)
                        // we should not do an explicit binding before
                        // loading a bind file. So, in this case, load
                        // the default bind file.
-                       if (!hasBindFile) {
-                               bind_file = bindFile;
-                               ReadBindFile();
-                       }
+                       readBindFileIfNeeded();
+
                        // !!!chb, dynamic key binding...
                        int action, res = 0;
                        string seq, cmd;
@@ -734,25 +731,6 @@ int LyXRC::read(string const & filename)
                                cursor_follows_scrollbar = lexrc.GetBool();
                        break;
 
-#if 0
-               case RC_FAX_COMMAND:
-                       if (lexrc.next())
-                               fax_command = lexrc.GetString();
-                       break;
-               case RC_FAXPROGRAM:
-                       if (lexrc.next())
-                               fax_program = lexrc.GetString();
-                       break;
-               case RC_PHONEBOOK:
-                       if (lexrc.next()) {
-                               string s = lexrc.GetString();
-                               if (AbsolutePath(s))
-                                       phone_book = s;
-                               else
-                                       phone_book = user_lyxdir + s;
-                       }
-                       break;
-#endif
                case RC_ASCIIROFF_COMMAND:
                        if (lexrc.next())
                                ascii_roff_command = lexrc.GetString();
@@ -912,6 +890,10 @@ int LyXRC::read(string const & filename)
                }
        }
 
+       /// Update converters data-structures
+       converters.Update(formats);
+       converters.BuildGraph();
+
        return 0;
 }
 
@@ -1357,24 +1339,6 @@ void LyXRC::output(ostream & os) const
                        os << "\\backupdir_path \"" << backupdir_path << "\"\n";
                }
 
-#if 0
-               os << "\n#\n"
-                  << "# FAX SECTION #######################################\n"
-                  << "#\n\n";
-               
-       case RC_FAX_COMMAND:
-               if (fax_command != system_lyxrc.fax_command) {
-                       os << "\\fax_command \"" << fax_command << "\"\n";
-               }
-       case RC_PHONEBOOK:
-               if (phone_book != system_lyxrc.phone_book) {
-                       os << "\\phone_book \"" << phone_book << "\"\n";
-               }
-       case RC_FAXPROGRAM:
-               if (fax_program != system_lyxrc.fax_program) {
-                       os << "\\fax_program \"" << fax_program << "\"\n";
-               }
-#endif
                os << "\n#\n"
                   << "# ASCII EXPORT SECTION ##############################\n"
                   << "#\n\n";
@@ -1759,16 +1723,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = N_("Use this to set the correct mapping file for your keyboard. You'll need this if you for instance want to type German documents on an American keyboard.");
                break;
 
-#if 0
-       case RC_FAX_COMMAND:
-               break;
-               
-       case RC_PHONEBOOK:
-               break;
-               
-       case RC_FAXPROGRAM:
-               break;
-#endif 
        case RC_ASCIIROFF_COMMAND:
                str = N_("Use to define an external program to render tables in the ASCII output. E.g. \"groff -t -Tlatin1 $$FName\"  where $$FName is the input file. If \"none\" is specified, an internal routine is used.");
                break;