diff options
| author | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-05-03 16:21:18 +0000 |
|---|---|---|
| committer | craig <craig@11d20701-8431-0410-a711-e3c959e3b870> | 2012-05-03 16:21:18 +0000 |
| commit | 87819d60bf3e5b5de4ff1486c4c07011a069347e (patch) | |
| tree | b5f2c55223e072eb914cc07d6dc9f10cfb77e20f /scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp | |
| parent | 020a92a1d225b2a84feb5dfbb8aa126801571d26 (diff) | |
| download | scribus-87819d60bf3e5b5de4ff1486c4c07011a069347e.tar.gz scribus-87819d60bf3e5b5de4ff1486c4c07011a069347e.tar.xz scribus-87819d60bf3e5b5de4ff1486c4c07011a069347e.zip | |
Bump hunspell some more. Word language now recorded from the char style and the words are checked against that dictionary if it exists. Fix (or break?) StoryText::nextWord.
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17491 11d20701-8431-0410-a711-e3c959e3b870
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); +} |
