2000-12-11 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+ * src/lyxrc.C (readBindFileIfNeeded): new method. Reads the main
+ bind file if it has not been done yet.
+ (read): remove local bindFile variable. Try to fix the handling of
+ RC_BIND and RC_BINDFILE.
+
+ * src/lyx_main.C (init): use readBindFileIfNeeded().
+
* lib/languages: Change description of german to "German (new
spelling)".
src/frontends/kde/tocdlg.C
src/frontends/kde/urldlg.C
src/frontends/xforms/FormBase.h
-src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCitation.C
-src/frontends/xforms/form_copyright.C
+src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
-src/frontends/xforms/form_document.C
+src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormDocument.C
-src/frontends/xforms/form_error.C
+src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C
-src/frontends/xforms/form_graphics.C
+src/frontends/xforms/form_error.C
src/frontends/xforms/FormGraphics.C
-src/frontends/xforms/form_index.C
+src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormIndex.C
+src/frontends/xforms/form_index.C
src/frontends/xforms/FormInset.h
-src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormParagraph.C
-src/frontends/xforms/form_preferences.C
+src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreferences.C
-src/frontends/xforms/form_print.C
+src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C
-src/frontends/xforms/form_ref.C
+src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
-src/frontends/xforms/form_tabular.C
+src/frontends/xforms/form_ref.C
src/frontends/xforms/FormTabular.C
-src/frontends/xforms/form_tabular_create.C
+src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C
-src/frontends/xforms/form_toc.C
+src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C
-src/frontends/xforms/form_url.C
+src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
+src/frontends/xforms/form_url.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/xform_helpers.C
// Ensure that we have really read a bind file, so that LyX is
// usable.
- if (!lyxrc.hasBindFile)
- lyxrc.ReadBindFile();
+ lyxrc.readBindFileIfNeeded();
// Read menus
ReadUIFile(lyxrc.ui_file);
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.
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;
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);
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;
// 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;
///
int read (string const & filename);
///
+ void readBindFileIfNeeded();
+ ///
void write(string const & filename) const;
///
void print() const;
///
void output(std::ostream & os) const;
- /// Is a bind file already (or currently) read?
- bool hasBindFile;
- ///
- int ReadBindFile(string const & name = "cua");
///
static string const getDescription(LyXRCTags);
///
bool cursor_follows_scrollbar;
///
int label_init_length;
+private:
+ /// Is a bind file already (or currently) read?
+ bool hasBindFile;
+ ///
+ int ReadBindFile(string const & name);
};
///