]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index 743cab70065e431c103dce2c4e74e4dca40c4536..dad021177248fa591ab6fb2792f421ad99a4d340 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,8 +227,6 @@ public:
                static QString const strCharacter = qt_("Character: ");
                static QString const strCodePoint = qt_("Code Point: ");
 
-               static char codeName[10];
-
                char_type c = symbols_.at(index.row()); 
 
                if (role == Qt::TextAlignmentRole)
@@ -237,6 +236,9 @@ public:
                        return toqstr(c);
 
                if (role == Qt::ToolTipRole) {
+                       // FIXME THREAD
+                       static char codeName[10];
+
                        sprintf(codeName, "0x%04x", c);
                        return strCharacter + toqstr(c) + '\n'
                                + strCodePoint + QLatin1String(codeName);
@@ -255,8 +257,7 @@ public:
 
 private:
        friend class GuiSymbols;
-       GuiSymbols * parent_;
-       
+
        QList<char_type> symbols_;
 };