commit a19be0314b3ed7be39088a6ae571fed1785f516b
Author: Guillaume Munch <[email protected]>
Date:   Sat Dec 3 23:35:15 2016 +0100

    GuiSymbols: fix char->block lookup
---
 src/frontends/qt4/GuiSymbols.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/frontends/qt4/GuiSymbols.cpp b/src/frontends/qt4/GuiSymbols.cpp
index cdfedee..4b314e8 100644
--- a/src/frontends/qt4/GuiSymbols.cpp
+++ b/src/frontends/qt4/GuiSymbols.cpp
@@ -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;
 }
 

Reply via email to