- cache symbols list (speedup).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22866
a592a061-630c-0410-9148-
cb99ea01b6c8
}
bool const show_all = categoryFilterCB->isChecked();
}
bool const show_all = categoryFilterCB->isChecked();
- typedef set<char_type> SymbolsList;
- Encoding enc = *(encodings.getFromLyXName(encoding_));
- SymbolsList symbols = enc.getSymbolsList();
+ if (symbols_.empty() || update_combo) {
+ Encoding enc = *(encodings.getFromLyXName(encoding_));
+ symbols_ = enc.getSymbolsList();
+ }
if (!show_all) {
for (int i = 0 ; i < no_blocks; ++i)
if (!show_all) {
for (int i = 0 ; i < no_blocks; ++i)
- SymbolsList::const_iterator const end = symbols.end();
- for (SymbolsList::const_iterator it = symbols.begin(); it != end; ++it) {
+ SymbolsList::const_iterator const end = symbols_.end();
+ for (SymbolsList::const_iterator it = symbols_.begin(); it != end; ++it) {
+ if (!update_combo && !show_all && (c <= range_start || c >= range_end))
+ continue;
#if QT_VERSION >= 0x040300
QChar::Category const cat = QChar::category(uint(c));
#else
#if QT_VERSION >= 0x040300
QChar::Category const cat = QChar::category(uint(c));
#else
// we do not want control or space characters
if (cat == QChar::Other_Control || cat == QChar::Separator_Space)
continue;
// we do not want control or space characters
if (cat == QChar::Other_Control || cat == QChar::Separator_Space)
continue;
- if (!update_combo && !show_all && (c <= range_start || c >= range_end))
- continue;
QListWidgetItem * lwi = new QListWidgetItem(toqstr(c));
if (show_all || c >= range_start && c <= range_end) {
lwi->setTextAlignment(Qt::AlignCenter);
QListWidgetItem * lwi = new QListWidgetItem(toqstr(c));
if (show_all || c >= range_start && c <= range_end) {
lwi->setTextAlignment(Qt::AlignCenter);
#include "ui_SymbolsUi.h"
#include <map>
#include "ui_SymbolsUi.h"
#include <map>
typedef std::map<QString, QListWidgetItem *> UsedBlocks;
///
UsedBlocks used_blocks;
typedef std::map<QString, QListWidgetItem *> UsedBlocks;
///
UsedBlocks used_blocks;
+ /// list of all symbols
+ typedef std::set<char_type> SymbolsList;
+ ///
+ SymbolsList symbols_;
};
} // namespace frontend
};
} // namespace frontend