[LyX/master] #6401 more robust processing on special char code insets when looking for spell checker ranges

Stephan Witt switt at lyx.org
Fri Aug 14 19:02:43 UTC 2020


commit 5bce66b1a38be7c7e622d57d896e1106ed3b48e0
Author: Stephan Witt <switt at lyx.org>
Date:   Fri Aug 14 21:28:24 2020 +0200

    #6401 more robust processing on special char code insets when looking for spell checker ranges
---
 src/Paragraph.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 45cc80e..99ab129 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -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);


More information about the lyx-cvs mailing list