]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index 8029265286dd925a624a1dc4cf9dbe202f4f935b..9eb902be32040dcd23d18872206ed2b75fd12690 100644 (file)
@@ -40,7 +40,7 @@ namespace {
 
 /// name of unicode block, start and end code point
 struct UnicodeBlocks {
-       QString name;
+       char const * name;
        char_type start;
        char_type end;
 };
@@ -163,7 +163,7 @@ QString getBlock(char_type c)
        // c falls into a covered area, and we can guess which
        if (c >= unicode_blocks[lastBlock].start
            && c <= unicode_blocks[lastBlock].end)
-               return unicode_blocks[lastBlock].name;
+               return qt_(unicode_blocks[lastBlock].name);
 
        // c falls into an uncovered area, but we can guess which       
        if (c > unicode_blocks[lastBlock].end
@@ -178,7 +178,7 @@ QString getBlock(char_type c)
                return QString();
        lastBlock = i;
        //LYXERR0("fail: " << int(c) << ' ' << lastBlock);
-       return unicode_blocks[lastBlock].name;
+       return qt_(unicode_blocks[lastBlock].name);
 }
 
 
@@ -383,13 +383,14 @@ void GuiSymbols::on_categoryFilterCB_toggled(bool on)
 
 void GuiSymbols::scrollToItem(QString const & category)
 {
-       if (used_blocks.find(category) != used_blocks.end()) {
-               int row = used_blocks[category];
-               QModelIndex index = symbolsLW->model()->index(row, 0, QModelIndex());
-               symbolsLW->scrollTo(index, QAbstractItemView::PositionAtTop);
-       }
+       if (used_blocks.find(category) == used_blocks.end())
+               return;
+       int row = used_blocks[category];
+       QModelIndex index = symbolsLW->model()->index(row, 0, QModelIndex());
+       symbolsLW->scrollTo(index, QAbstractItemView::PositionAtTop);
 }
 
+
 void GuiSymbols::updateSymbolList(bool update_combo)
 {
        QString category = categoryCO->currentText();
@@ -408,7 +409,7 @@ void GuiSymbols::updateSymbolList(bool update_combo)
 
        if (!show_all) {
                for (int i = 0 ; i < no_blocks; ++i)
-                       if (unicode_blocks[i].name == category) {
+                       if (qt_(unicode_blocks[i].name) == category) {
                                range_start = unicode_blocks[i].start;
                                range_end = unicode_blocks[i].end;
                                break;
@@ -424,8 +425,7 @@ void GuiSymbols::updateSymbolList(bool update_combo)
 #if QT_VERSION >= 0x040300
                QChar::Category const cat = QChar::category(uint(c));
 #else
-               QChar const qc = uint(c);
-               QChar::Category const cat = qc.category();
+               QChar::Category const cat = QChar(uint(c)).category();
 #endif
                // we do not want control or space characters
                if (cat == QChar::Other_Control || cat == QChar::Separator_Space)