#6401 more robust processing on special char code insets when looking for spell checker ranges

This commit is contained in:
Stephan Witt 2020-08-14 21:28:24 +02:00
parent 48b1e8a0ac
commit 5bce66b1a3

View File

@ -4503,7 +4503,18 @@ Language * Paragraph::Private::locateSpellRange(
while (last < to && samelang && sameinset) { while (last < to && samelang && sameinset) {
// hop to end of word // hop to end of word
while (last < to && !owner_->isWordSeparator(last)) { while (last < to && !owner_->isWordSeparator(last)) {
if (owner_->getInset(last)) { Inset const * inset = owner_->getInset(last);
if (inset && inset->lyxCode() == SPECIALCHAR_CODE) {
// check for "invisible" letters such as ligature breaks
odocstringstream os;
inset->toString(os);
if (os.str().length() != 0) {
// avoid spell check of visible special char insets
// stop the loop in front of the special char inset
sameinset = false;
break;
}
} else if (inset) {
appendSkipPosition(skips, last); appendSkipPosition(skips, last);
} else if (owner_->isDeleted(last)) { } else if (owner_->isDeleted(last)) {
appendSkipPosition(skips, last); appendSkipPosition(skips, last);