r21739 by craig - Add back encoding conversion to std::string based hunspell code

scribus-commit scribus-commit at lists.scribus.net
Fri Jan 20 22:02:55 UTC 2017


Author: craig
Date: Fri Jan 20 22:02:55 2017
New Revision: 21739

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21739
Log:
Add back encoding conversion to std::string based hunspell code

Modified:
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21739&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp	Fri Jan 20 22:02:55 2017
@@ -66,7 +66,7 @@
 {
 	if (!m_hunspell)
 		return -1;
-	std::string s = word.toStdString();
+	std::string s = m_codec->fromUnicode(word).toStdString();
 	return m_hunspell->spell(s);
 }
 
@@ -78,7 +78,7 @@
 	std::string s = word.toStdString();
 	std::vector<std::string> sugglist = m_hunspell->suggest(s);
 	for (uint i = 0; i < sugglist.size(); ++i)
-		replacements << QString::fromStdString(sugglist[i]);
+		replacements << m_codec->toUnicode(QByteArray::fromStdString(sugglist[i]));
 	return replacements;
 }
 #endif




More information about the scribus-commit mailing list