summaryrefslogtreecommitdiffstats
path: root/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-05-03 16:21:18 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-05-03 16:21:18 +0000
commit87819d60bf3e5b5de4ff1486c4c07011a069347e (patch)
treeb5f2c55223e072eb914cc07d6dc9f10cfb77e20f /scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
parent020a92a1d225b2a84feb5dfbb8aa126801571d26 (diff)
downloadscribus-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/hunspellpluginimpl.cpp')
-rw-r--r--scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp b/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
index ee4ed23..cbbd675 100644
--- a/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
+++ b/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
@@ -163,16 +163,18 @@ bool HunspellPluginImpl::parseTextFrame(StoryText *iText)
{
int len=iText->length();
int wordCount=0,wordNo=0,errorCount=0;
- int currPos=0;
+ int currPos=0, wordPos=0;
while (currPos<len)
{
- int wordPos=iText->nextWord(currPos);
+ wordPos=iText->nextWord(currPos);
currPos=wordPos;
int eoWord=wordPos;
while(eoWord < len)
{
- if (iText->text(eoWord).isLetterOrNumber())
+ if (iText->text(eoWord).isLetter())
+ {
++eoWord;
+ }
else
break;
}
@@ -203,7 +205,7 @@ bool HunspellPluginImpl::parseTextFrame(StoryText *iText)
QStringList replacements;
if (hspellers[spellerIndex]->spell(word.toUtf8().constData())==0)
{
-// qDebug()<<word;
+// qDebug()<<word<<wordLang;
++errorCount;
char **sugglist = NULL;
int suggCount=hspellers[spellerIndex]->suggest(&sugglist, word.toUtf8().constData());
@@ -222,10 +224,10 @@ bool HunspellPluginImpl::parseTextFrame(StoryText *iText)
wf.changed=false;
wf.ignore=false;
wf.changeOffset=0;
+ wf.lang=wordLang;
wordsToCorrect.append(wf);
}
}
-// qDebug()<<"Errors found:"<<errorCount;
return true;
}