summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/hunspell
diff options
context:
space:
mode:
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)