]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index d8e713e100407b26354641d57776ec92f1685398..6bd5ba210a4bf1f9fcbed1c4751b482422dd8749 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Jürgen Spitzmüller
+ * \author Jürgen Spitzmüller
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -19,6 +19,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "Cursor.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
 
@@ -30,6 +31,8 @@
 #include <QListWidgetItem>
 #include <QString>
 
+#include <cstdio>
+
 using namespace std;
 
 namespace lyx {
@@ -383,13 +386,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();
@@ -424,14 +428,13 @@ 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)
                        continue;
                ++numItem;
-               if (show_all || c >= range_start && c <= range_end)
+               if (show_all || (c >= range_start && c <= range_end))
                        s.append(c);
                if (update_combo) {
                        QString block = getBlock(c);
@@ -476,4 +479,4 @@ Dialog * createGuiSymbols(GuiView & lv)
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiSymbols_moc.cpp"
+#include "moc_GuiSymbols.cpp"