Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 24126 → Rev 24127

/branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
51,6 → 51,14
goToNextWord(0);
}
 
void HunspellDialog::updateSuggestions(const WordsFound& wordFound)
{
QStringList suggestions;
if (m_hspellerMap->contains(wordFound.lang))
suggestions = (*m_hspellerMap)[wordFound.lang]->suggest(wordFound.w);
updateSuggestions(suggestions);
}
 
void HunspellDialog::updateSuggestions(QStringList &newSuggestions)
{
suggestionsListWidget->clear();
75,7 → 83,7
} while (wfListIndex<m_wfList->count() && (m_wfList->at(wfListIndex).changed || m_wfList->at(wfListIndex).ignore));
//qDebug()<<"selected word index"<<wfListIndex;
}
if (wfListIndex>=m_wfList->count())
if (wfListIndex >= m_wfList->count())
{
statusLabel->setText(tr("Spelling check complete"));
suggestionsListWidget->clear();
90,7 → 98,7
statusLabel->setText("");
currWF = m_wfList->at(wfListIndex);
setLanguageCombo(currWF.lang);
updateSuggestions(currWF.replacements);
updateSuggestions(currWF);
 
int sentencePos = 0;
QString sentence(m_iText->sentence(currWF.start + currWF.changeOffset, sentencePos));
/branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.h
21,8 → 21,11
public:
HunspellDialog(QWidget* parent, ScribusDoc *doc, StoryText* iText);
~HunspellDialog() {};
 
void set(QMap<QString, QString>* dictionaryMap, QMap<QString, HunspellDict*> *hspellerMap, QList<WordsFound>* wfList);
bool docChanged() {return m_docChanged;}
 
void updateSuggestions(const WordsFound& wordFound);
void updateSuggestions(QStringList& newSuggestions);
 
public slots:
/branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
129,11 → 129,11
if (!dictionaryMap.contains(langAbbrev))
{
//qDebug()<<"Spelling language to match style language not installed ("<<langAbbrev<<")";
QString langAbbrev2=LanguageManager::instance()->getAbbrevFromLang(wordLang, false, false, 2);
QString langAbbrev2 = LanguageManager::instance()->getAbbrevFromLang(wordLang, false, false, 2);
if (!langAbbrev2.isEmpty() && dictionaryMap.contains(langAbbrev2))
{
//qDebug()<<"Spelling language swapped to :"<<langAbbrev2;
langAbbrev=langAbbrev2;
langAbbrev = langAbbrev2;
}
}
else
142,7 → 142,7
QMap<QString, QString>::iterator it = dictionaryMap.begin();
while (it != dictionaryMap.end())
{
if (it.key()==langAbbrev)
if (it.key() == langAbbrev)
break;
++i;
++it;
152,14 → 152,13
if (hspellerMap.contains(langAbbrev) && hspellerMap[langAbbrev]->spell(word)==0)
{
struct WordsFound wf;
wf.start=wordStart;
wf.end=wordEnd;
wf.w=word;
wf.changed=false;
wf.ignore=false;
wf.changeOffset=0;
wf.start = wordStart;
wf.end = wordEnd;
wf.w = word;
wf.changed = false;
wf.ignore = false;
wf.changeOffset = 0;
wf.lang = langAbbrev;
wf.replacements = hspellerMap[langAbbrev]->suggest(word);
wordsToCorrect.append(wf);
}
currPos = iText->nextWord(wordStart);
/branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginstructs.h
8,7 → 8,6
int start;
int end;
QString w;
QStringList replacements;
bool changed;
bool ignore;
int changeOffset;