Bug 1269941 - Upgrade to Hunspell 1.4.1. r=ehsan

This commit is contained in:
Ryan VanderMeulen 2016-05-03 19:00:00 -04:00
parent 174671db1d
commit 0ddefc4583
3 changed files with 6 additions and 6 deletions

View File

@ -1,2 +1,2 @@
Hunspell Version: 1.4.0
Hunspell Version: 1.4.1
Additional Patches: See patches directory.

View File

@ -2783,7 +2783,7 @@ class is_any_of {
bool operator()(char c) { return chars.find(c) != std::string::npos; }
private:
const std::string& chars;
std::string chars;
};
}

View File

@ -1088,10 +1088,10 @@ int SuggestMgr::movechar(char** wlst,
std::copy(word, word + candidate.size(), candidate.begin());
}
for (std::string::iterator p = candidate.begin() + candidate.size() - 1; p > candidate.begin(); --p) {
for (std::string::iterator q = p - 1; q >= candidate.begin() && std::distance(q, p) < 10; --q) {
std::swap(*q, *(q + 1));
if (std::distance(q, p) < 2)
for (std::string::reverse_iterator p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
for (std::string::reverse_iterator q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) < 10; ++q) {
std::swap(*q, *(q - 1));
if (std::distance(p, q) < 2)
continue; // omit swap char
ns = testsug(wlst, candidate.c_str(), candidate.size(), ns, cpdsuggest, NULL, NULL);
if (ns == -1)