]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
Use QFontMetrics information for underlines (and friends) width and position
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index 743cab70065e431c103dce2c4e74e4dca40c4536..6ccecf52411a4777fe8b2fc30938ac44a03656fb 100644 (file)
@@ -153,6 +153,7 @@ const int no_blocks = sizeof(unicode_blocks) / sizeof(UnicodeBlocks);
 QString getBlock(char_type c)
 {
        // store an educated guess for the next search
+       // FIXME THREAD
        static int lastBlock = 0;
 
        // "clever reset"
@@ -175,7 +176,7 @@ QString getBlock(char_type c)
 
        // guessing was wrong so far. do a real search.
        int i = 0;
-       while (c > unicode_blocks[i].end && i < no_blocks)
+       while (i < no_blocks && c > unicode_blocks[i].end)
                ++i;
        if (i == no_blocks)
                return QString();
@@ -198,7 +199,7 @@ class GuiSymbols::Model : public QAbstractItemModel
 {
 public:
        Model(GuiSymbols * parent)
-               : QAbstractItemModel(parent), parent_(parent)
+               : QAbstractItemModel(parent)
        {}
 
        QModelIndex index(int row, int column, QModelIndex const &) const
@@ -226,6 +227,7 @@ public:
                static QString const strCharacter = qt_("Character: ");
                static QString const strCodePoint = qt_("Code Point: ");
 
+               // FIXME THREAD
                static char codeName[10];
 
                char_type c = symbols_.at(index.row()); 
@@ -255,8 +257,7 @@ public:
 
 private:
        friend class GuiSymbols;
-       GuiSymbols * parent_;
-       
+
        QList<char_type> symbols_;
 };