r24119 by jghali - #16288: For some CTL script languages spellcheck word correction is wrong

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 29 10:25:41 UTC 2020


Author: jghali
Date: Thu Oct 29 10:25:41 2020
New Revision: 24119

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24119
Log:
#16288: For some CTL script languages spellcheck word correction is wrong

Modified:
    trunk/Scribus/scribus/text/storytext.cpp

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24119&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp	(original)
+++ trunk/Scribus/scribus/text/storytext.cpp	Thu Oct 29 10:25:41 2020
@@ -1057,6 +1057,15 @@
 
 QString StoryText::word(int pos)
 {
+	BreakIterator* it = getWordIterator();
+	if (it)
+	{
+		it->setText((const UChar*) plainText().utf16());
+		int end = it->following(pos);
+		return text(pos, end - pos);
+	}
+
+	// Fallback to old code
 	int eoWord = pos;
 	while (eoWord < length())
 	{




More information about the scribus-commit mailing list