Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions feathernotes/spellChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SpellChecker::SpellChecker (const QString& dictionaryPath, const QString& userDi
QTextStream stream (&_affixFile);
QRegularExpression encDetector ("^\\s*SET\\s+([A-Z0-9\\-]+)\\s*", QRegularExpression::CaseInsensitiveOption);
QRegularExpressionMatch match;
for (QString line = stream.readLine(); !line.isEmpty(); line = stream.readLine())
QString line;
while (stream.readLineInto (&line))
{
if (line.indexOf (encDetector, 0, &match) > -1)
{
Expand All @@ -67,8 +68,12 @@ SpellChecker::SpellChecker (const QString& dictionaryPath, const QString& userDi
if (userDictonaryFile.open (QIODevice::ReadOnly))
{
QTextStream stream (&userDictonaryFile);
for (QString word = stream.readLine(); !word.isEmpty(); word = stream.readLine())
ignoreWord (word);
QString word;
while (stream.readLineInto (&word))
{
if (!word.isEmpty())
ignoreWord (word);
}
userDictonaryFile.close();
}
}
Expand Down