]> git.lyx.org Git - features.git/commitdiff
Take into account that '\' is always part of a LaTeX command and also
authorEnrico Forestieri <forenr@lyx.org>
Tue, 23 Dec 2008 02:03:53 +0000 (02:03 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 23 Dec 2008 02:03:53 +0000 (02:03 +0000)
that entries in the unicodesymbols file may not start with '\'.
Maybe the method should be renamed as fromLaTeXCode?

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27957 a592a061-630c-0410-9148-cb99ea01b6c8

src/Encoding.cpp

index 8041de988f1ccaf2c0dc82155e1cf379e4ab4873..69437bf2f5192adb260084690ea2f2f272cada16 100644 (file)
@@ -496,8 +496,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)
-                           && ((tmp.size() == 1 && !isAlphaASCII(tmp[0]))
-                                   || k == cmdend || !isAlphaASCII(cmd[k]))) {
+                           && (tmp[0] != '\\'
+                                  || (tmp.size() == 2 && !isAlphaASCII(tmp[1]))
+                                  || k == cmdend || !isAlphaASCII(cmd[k]))) {
                                c = it->first;
                                j = k - 1;
                                i = j + 1;