mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdeui: fix spell check of words at ends
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
bb1e962276
commit
2b45ac1a73
2 changed files with 4 additions and 4 deletions
|
@ -278,8 +278,8 @@ void KSpeller::start()
|
|||
const bool atseparator = KSpeller::isWordSeparator(d->text.at(counter));
|
||||
if (!atseparator && wordstart == -1) {
|
||||
wordstart = counter;
|
||||
} else if (atseparator && wordstart != -1) {
|
||||
const QString word = d->text.mid(wordstart, counter - wordstart);
|
||||
} else if ((atseparator || (counter + 1) == d->text.size()) && wordstart != -1) {
|
||||
const QString word = d->text.mid(wordstart, counter - wordstart + (atseparator ? 0 : 1));
|
||||
// not worth checking if it is less than two characters
|
||||
if (word.size() >= 2) {
|
||||
// qDebug() << Q_FUNC_INFO << wordstart << counter << word;
|
||||
|
|
|
@ -101,8 +101,8 @@ void KSpellHighlighter::highlightBlock(const QString &text)
|
|||
const bool atseparator = KSpeller::isWordSeparator(text.at(counter));
|
||||
if (!atseparator && wordstart == -1) {
|
||||
wordstart = counter;
|
||||
} else if (atseparator && wordstart != -1) {
|
||||
const QString word = text.mid(wordstart, counter - wordstart);
|
||||
} else if ((atseparator || (counter + 1) == text.size()) && wordstart != -1) {
|
||||
const QString word = text.mid(wordstart, counter - wordstart + (atseparator ? 0 : 1));
|
||||
// not worth checking if it is less than two characters
|
||||
if (word.size() >= 2) {
|
||||
if (!d->speller.check(word)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue