diff options
Diffstat (limited to 'scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp')
-rw-r--r-- | scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp b/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp index b10a56f..6c9087a 100644 --- a/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp +++ b/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp @@ -40,7 +40,8 @@ void HunspellDialog::set(QMap<QString, QString>* dictionaryMap, Hunspell **hspel QMap<QString, QString>::iterator it = m_dictionaryMap->begin(); while (it != dictionaryMap->end()) { - languagesComboBox->addItem(LanguageManager::instance()->getLangFromAbbrev(it.key(), true)); + QString lang=LanguageManager::instance()->getLangFromAbbrev(it.key(), true); + languagesComboBox->addItem(!lang.isEmpty() ? lang : it.key()); ++it; } languagesComboBox->setCurrentIndex(0); @@ -86,6 +87,7 @@ void HunspellDialog::goToNextWord(int i) else statusLabel->setText(""); currWF=m_wfList->at(wfListIndex); + setLanguageCombo(currWF.lang); updateSuggestions(currWF.replacements); int sentencePos=0; @@ -173,3 +175,19 @@ void HunspellDialog::languageComboChanged(int index) goToNextWord(); } } + +void HunspellDialog::setLanguageCombo(const QString &newLangAbbrev) +{ + QMap<QString, QString>::iterator it = m_dictionaryMap->begin(); + int i=0; + while (it != m_dictionaryMap->end()) + { + if (it.key()==newLangAbbrev) + break; + ++i; + ++it; + } + bool b=languagesComboBox->blockSignals(true); + languagesComboBox->setCurrentIndex(i); + languagesComboBox->blockSignals(b); +} |