]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSymbols.cpp
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / src / frontends / qt4 / GuiSymbols.cpp
index d8e713e100407b26354641d57776ec92f1685398..864b7b49c41cd6ea416b7e65e4ac1311a33486c6 100644 (file)
@@ -19,6 +19,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
+#include "Cursor.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
 
@@ -383,13 +384,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,8 +426,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)