diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-05-13 19:32:21 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-05-13 19:32:21 +0000 |
commit | 37c98eaad76b7f1bf86c75fe2c32cf6aa11f7c6f (patch) | |
tree | 32aede144aa0cd0f2dd058b003cdbd534a2f969c /libs/hunspell/src/replist.c++ | |
parent | e73bb3845517a31fa795e8d2174fcc8572835b33 (diff) |
SpellChecker: Updated hunspell to 1.4.1
git-svn-id: http://svn.miranda-ng.org/main/trunk@16828 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'libs/hunspell/src/replist.c++')
-rw-r--r-- | libs/hunspell/src/replist.c++ | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/hunspell/src/replist.c++ b/libs/hunspell/src/replist.c++ index ace6c4aaf8..b3e6b37d20 100644 --- a/libs/hunspell/src/replist.c++ +++ b/libs/hunspell/src/replist.c++ @@ -151,7 +151,7 @@ int RepList::add(char* pat1, char* pat2) { } int RepList::conv(const char* word, char* dest, size_t destsize) { - int stl = 0; + size_t stl = 0; int change = 0; for (size_t i = 0; i < strlen(word); i++) { int n = near(word + i); @@ -173,3 +173,21 @@ int RepList::conv(const char* word, char* dest, size_t destsize) { dest[stl] = '\0'; return change; } + +bool RepList::conv(const char* word, std::string& dest) { + dest.clear(); + + bool change = false; + for (size_t i = 0; i < strlen(word); i++) { + int n = near(word + i); + int l = match(word + i, n); + if (l) { + dest.append(dat[n]->pattern2); + i += l - 1; + change = true; + } else { + dest.push_back(word[i]); + } + } + return change; +} |