]> git.lyx.org Git - features.git/commitdiff
Fix reading of symbols file
authorDekel Tsur <dekelts@tau.ac.il>
Sun, 2 Sep 2001 13:35:31 +0000 (13:35 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Sun, 2 Sep 2001 13:35:31 +0000 (13:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2655 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/Makefile.am
src/mathed/ChangeLog
src/mathed/math_hash.C

index f6db7d1a9f4dbc525de1d822ebfbe2cb208e4e6f..05238b2c15a085c2acd0b840d97977419b322167 100644 (file)
@@ -1,3 +1,7 @@
+2001-09-02  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * Makefile.am (pkgdata_DATA): Add symbols file.
+
 2001-09-01  John Levon  <moz@compsoc.man.ac.uk>
 
        * configure:
index 1f766798343ef71b380fc8f30f33a8bdd30136e2..8b576969dce25148548b569557db7051d6a0c8f5 100644 (file)
@@ -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
index 978b4f9d76fc92e8902e96477d67173c4a8c4e7d..1e89500343ecb7c404d70d70ce6ab049986af953 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-02  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * math_hash.C (in_word_set): Initialize symbol table even when
+       symbols file was not found.
+
 2001-09-02  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * math_hash.C: added a using std::endl directive.
index 304cc12db70e5fe9cf600977a08ef4745b7dc568..c8f221d4457ce299ae527d59dad6f6f3939b95e7 100644 (file)
@@ -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;
        }