From: Dekel Tsur Date: Sun, 2 Sep 2001 13:35:31 +0000 (+0000) Subject: Fix reading of symbols file X-Git-Tag: 1.6.10~20691 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f5de290c504e82599bec5ebcac7a451e54e2f17c;p=features.git Fix reading of symbols file git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2655 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index f6db7d1a9f..05238b2c15 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-09-02 Dekel Tsur + + * Makefile.am (pkgdata_DATA): Add symbols file. + 2001-09-01 John Levon * configure: diff --git a/lib/Makefile.am b/lib/Makefile.am index 1f76679834..8b576969dc 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -33,7 +33,7 @@ LIBDISTFILES = $(BIND) $(CLIPART) $(DOCDIST) $(EXAMPLES) $(IMAGES) $(KBD) \ pkgdata_DATA = lyxrc.example CREDITS chkconfig.ltx lyxrc.defaults \ textclass.lst packages.lst external_templates \ - encodings languages + encodings languages symbols LYXLIBDIRS = bind clipart doc examples images kbd layouts scripts \ templates tex ui diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 978b4f9d76..1e89500343 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2001-09-02 Dekel Tsur + + * math_hash.C (in_word_set): Initialize symbol table even when + symbols file was not found. + 2001-09-02 Angus Leeming * math_hash.C: added a using std::endl directive. diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index 304cc12db7..c8f221d445 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -154,16 +154,6 @@ bool initialized = false; void ReadSymbols(string const & filename) { - for (latexkeys_a * p = wordlist_array; !string(p->name).empty(); ++p) { - latexkeys tmp; - tmp.name = p->name; - tmp.token = p->token; - tmp.id = p->id; - tmp.type = LMB_NONE; - tmp.latex_font_id = 0; - wordlist.push_back(tmp); - } - LyXLex lex(0, 0); lex.setFile(filename); while (lex.isOK()) { @@ -209,6 +199,27 @@ void ReadSymbols(string const & filename) wordlist.push_back(tmp); } +} + + +void InitSymbols() +{ + for (latexkeys_a * p = wordlist_array; !string(p->name).empty(); ++p) { + latexkeys tmp; + tmp.name = p->name; + tmp.token = p->token; + tmp.id = p->id; + tmp.type = LMB_NONE; + tmp.latex_font_id = 0; + wordlist.push_back(tmp); + } + + lyxerr[Debug::MATHED] << "Reading symbols file\n"; + string const file = LibFileSearch(string(), "symbols"); + if (file.empty()) + lyxerr << "Could not find symbols file" << endl; + else + ReadSymbols(file); std::sort(wordlist.begin(), wordlist.end()); } @@ -217,12 +228,7 @@ void ReadSymbols(string const & filename) latexkeys const * in_word_set(string const & str) { if (!initialized) { - lyxerr[Debug::MATHED] << "Reading symbols file\n"; - string const file = LibFileSearch(string(), "symbols"); - if (file.empty()) - lyxerr << "Could not find symbols file" << endl; - else - ReadSymbols(file); + InitSymbols(); initialized = true; }