]> git.lyx.org Git - features.git/commitdiff
GuiSymbols: fix char->block lookup
authorGuillaume Munch <gm@lyx.org>
Sat, 3 Dec 2016 22:35:15 +0000 (23:35 +0100)
committerGuillaume Munch <gm@lyx.org>
Sat, 3 Dec 2016 22:35:15 +0000 (23:35 +0100)
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;
 }