Check for duplicate symbols.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2668 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-09-03 16:46:28 +00:00
parent 8298940583
commit a9bea7bbdc
2 changed files with 10 additions and 3 deletions

View 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.

View 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;
}
}