]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiSymbols.cpp
Hack to display section symbol
[lyx.git] / src / frontends / qt / GuiSymbols.cpp
index 4a6b0d61787fbec3f782900a8f45607e6dda0e0c..d6a19269385d6f81f2e82ce403afed5a04f907c7 100644 (file)
@@ -169,7 +169,7 @@ QString getBlock(char_type c)
 
        // c falls into an uncovered area, but we can guess which
        if (c > unicode_blocks[lastBlock].end
-           && c < unicode_blocks[lastBlock + 1].start)
+           && (lastBlock == no_blocks-1 || c < unicode_blocks[lastBlock + 1].start))
                return QString();
 
        // guessing was wrong so far. do a real search.
@@ -409,12 +409,12 @@ void GuiSymbols::on_symbolsLW_clicked(QModelIndex const & index)
 }
 
 
-void GuiSymbols::on_categoryCO_activated(QString const & text)
+void GuiSymbols::on_categoryCO_activated(int)
 {
        if (!categoryFilterCB->isChecked())
                updateSymbolList(false);
        else
-               scrollToItem(text);
+               scrollToItem(categoryCO->currentText());
 }
 
 
@@ -473,11 +473,8 @@ void GuiSymbols::updateSymbolList(bool update_combo)
                ++numItem;
                if (show_all || (c >= range_start && c <= range_end))
                        s.append(c);
-               if (update_combo) {
-                       QString block = getBlock(c);
-                       if (used_blocks.find(block) == used_blocks.end())
-                               used_blocks[block] = numItem;
-               }
+               if (update_combo)
+                       used_blocks.insert({getBlock(c), numItem});
        }
        model_->setSymbols(s, enc);
 
@@ -507,12 +504,6 @@ void GuiSymbols::dispatchParams()
 }
 
 
-Dialog * createGuiSymbols(GuiView & lv)
-{
-       return new GuiSymbols(lv);
-}
-
-
 } // namespace frontend
 } // namespace lyx