]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
GuiSymbols: fix char->block lookup
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index cdfedee4e7b2b143b2cd89358db4cb593b046288..4b314e8379e0bf8aa071c9a0468406d110dbffb9 100644 (file)
@@ -177,10 +177,10 @@ QString getBlock(char_type c)
        int i = 0;
        while (i < no_blocks && c > unicode_blocks[i].end)
                ++i;
-       if (i == no_blocks)
+       if (i == no_blocks || c < unicode_blocks[i].start)
                return QString();
+       // cache the last block for guessing next time
        lastBlock = i;
-       //LYXERR0("fail: " << int(c) << ' ' << lastBlock);
        return unicode_blocks[lastBlock].qname;
 }