summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/hunspell
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-02-08 21:09:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-02-08 21:09:39 +0000
commit861cabec0529cc44e7d8741629bbfa9701dd40ad (patch)
treebab57f5e51b3b6e2c830ebe7bab15af8fdd05fbf /plugins/SpellChecker/src/hunspell
parent1451c41ce6f6f6921c70bcfe0aea52ae48ffc515 (diff)
- crash fix in hunspell
- warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@3493 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/hunspell')
-rw-r--r--plugins/SpellChecker/src/hunspell/hunspell.cxx15
-rw-r--r--plugins/SpellChecker/src/hunspell/hunvisapi.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/plugins/SpellChecker/src/hunspell/hunspell.cxx b/plugins/SpellChecker/src/hunspell/hunspell.cxx
index 8e00e1b8cc..6b35fb51e0 100644
--- a/plugins/SpellChecker/src/hunspell/hunspell.cxx
+++ b/plugins/SpellChecker/src/hunspell/hunspell.cxx
@@ -242,10 +242,25 @@ int Hunspell::mkallcap2(char * p, w_char * u, int nc)
void Hunspell::mkallsmall(char * p)
{
+ if (utf8) {
+ w_char u[MAXWORDLEN];
+ int nc = u8_u16(u, MAXWORDLEN, p);
+ unsigned short idx;
+ for (int i = 0; i < nc; i++) {
+ idx = (u[i].h << 8) + u[i].l;
+ unsigned short low = unicodetolower(idx, langnum);
+ if (idx != low) {
+ u[i].h = (unsigned char) (low >> 8);
+ u[i].l = (unsigned char) (low & 0x00FF);
+ }
+ }
+ u16_u8(p, MAXWORDUTF8LEN, u, nc);
+ } else {
while (*p != '\0') {
*p = csconv[((unsigned char) *p)].clower;
p++;
}
+ }
}
int Hunspell::mkallsmall2(char * p, w_char * u, int nc)
diff --git a/plugins/SpellChecker/src/hunspell/hunvisapi.h b/plugins/SpellChecker/src/hunspell/hunvisapi.h
index 4712280ad2..e466db9df1 100644
--- a/plugins/SpellChecker/src/hunspell/hunvisapi.h
+++ b/plugins/SpellChecker/src/hunspell/hunvisapi.h
@@ -1,6 +1,8 @@
#ifndef _HUNSPELL_VISIBILITY_H_
#define _HUNSPELL_VISIBILITY_H_
+#pragma warning(disable:4267)
+
#if defined(HUNSPELL_STATIC)
# define LIBHUNSPELL_DLL_EXPORTED
#elif defined(_MSC_VER)