]> git.lyx.org Git - features.git/commitdiff
Check for duplicate symbols.
authorDekel Tsur <dekelts@tau.ac.il>
Mon, 3 Sep 2001 16:46:28 +0000 (16:46 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Mon, 3 Sep 2001 16:46:28 +0000 (16:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2668 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_hash.C

index a2ccdb77aa806d82e3c9ec8e7ab1d0e249350683..5c3683bab11829bd80ac058091a2bad9bb75aa0b 100644 (file)
@@ -1,3 +1,7 @@
+2001-09-03  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * math_hash.C (ReadSymbols): Check for duplicate symbols
+
 2001-09-02  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * support.C: added a using std::map directive.
index 9c24fd243fda25ea6ef45507c994ea7bbfa8456e..a0eb1eeb43cc3cfea9b951a48f60f6286828ed52 100644 (file)
@@ -4,7 +4,6 @@
 #include "lyxlex.h"
 #include "debug.h"
 #include "support/filetools.h" // LibFileSearch
-#include "support/lyxfunctional.h"
 
 #include <map>
 
@@ -131,7 +130,7 @@ latexkeys_a wordlist_array[] =
        {"widetilde",  LM_TK_DECORATION, 0},
        {"{",  LM_TK_SPECIAL, '{'},
        {"|",  LM_TK_UNDEF, '|'},
-       {"}",  LM_TK_SPECIAL, '}'},
+       {"}",  LM_TK_SPECIAL, '}'}
 };
 
 
@@ -184,7 +183,11 @@ void ReadSymbols(string const & filename)
                        tmp.id = lex.getInteger();
                if (lex.next())
                        tmp.type = symbolType(lex.getString());
-               wordlist[tmp.name] = tmp;
+               if (wordlist.find(tmp.name) != wordlist.end())
+                       lyxerr << "ReadSymbols: token " << tmp.name
+                              << " already exists.\n";
+               else
+                       wordlist[tmp.name] = tmp;
        }
 }