]> git.lyx.org Git - lyx.git/commitdiff
#6401 more robust processing on special char code insets when looking for spell check...
authorStephan Witt <switt@lyx.org>
Fri, 14 Aug 2020 19:28:24 +0000 (21:28 +0200)
committerStephan Witt <switt@lyx.org>
Fri, 14 Aug 2020 19:28:24 +0000 (21:28 +0200)
src/Paragraph.cpp

index 45cc80ef6aeaa1d426e6bfc01ec5d6d3808729bc..99ab12967f69ef58accbc24e635fba7f221605e7 100644 (file)
@@ -4503,7 +4503,18 @@ Language * Paragraph::Private::locateSpellRange(
        while (last < to && samelang && sameinset) {
                // hop to end of word
                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);
                        } else if (owner_->isDeleted(last)) {
                                appendSkipPosition(skips, last);