* Encoding.cpp (fromLaTeXCommand): fix bug when the string passed

to the method does not match any of the known unicode symbols.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27953 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-12-22 15:23:05 +00:00
parent 3135ff4959
commit df8bb4edcd

View File

@ -23,6 +23,7 @@
#include "support/debug.h"
#include "support/FileName.h"
#include "support/lstrings.h"
#include "support/textutils.h"
#include "support/unicode.h"
#include <boost/cstdint.hpp>
@ -494,7 +495,9 @@ docstring Encodings::fromLaTeXCommand(docstring const & cmd, docstring & rem)
// If this is an exact match, we found a (longer)
// matching command in the unicodesymbols file
if (math == tmp || text == tmp) {
if ((math == tmp || text == tmp)
&& ((tmp.size() == 1 && !isAlphaASCII(tmp[0]))
|| k == cmdend || !isAlphaASCII(cmd[k]))) {
c = it->first;
j = k - 1;
i = j + 1;