diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-30 09:27:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-12-14 20:18:07 +0000 |
commit | d423121dba0ad19d307fe8aebfcf566a8b44dc1a (patch) | |
tree | fbb33147e2771c4152e02c498efc24f681c3af76 | |
parent | 5ecd7ebbdf752eac48442006137d62426bf63c84 (diff) |
update to latest hunspell 1-5 release
Change-Id: Ifb412506f2e36878d44d0e4f6360ae8d070ffa15
Reviewed-on: https://gerrit.libreoffice.org/28488
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | download.lst | 2 | ||||
-rw-r--r-- | external/hunspell/UnpackedTarball_hunspell.mk | 5 | ||||
-rw-r--r-- | external/hunspell/hunspell-solaris.patch | 12 | ||||
-rw-r--r-- | external/hunspell/hunspell-windows.patch | 21 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 44 |
6 files changed, 39 insertions, 49 deletions
diff --git a/configure.ac b/configure.ac index 251d048e5477..62cb35eb3ecf 100644 --- a/configure.ac +++ b/configure.ac @@ -9562,7 +9562,7 @@ if test "$with_system_hunspell" = "yes"; then HUNSPELL_LIBS=-lhunspell fi AC_LANG_POP([C++]) - libo_MINGW_CHECK_DLL([libhunspell-1.4]) + libo_MINGW_CHECK_DLL([libhunspell-1.5]) HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") FilterLibs "${HUNSPELL_LIBS}" HUNSPELL_LIBS="${filteredlibs}" @@ -9573,7 +9573,7 @@ else if test "$COM" = "MSC"; then HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib" else - HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.4" + HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.5" fi BUILD_TYPE="$BUILD_TYPE HUNSPELL" fi diff --git a/download.lst b/download.lst index 9d7af4f9111a..855f5b6080c8 100644 --- a/download.lst +++ b/download.lst @@ -61,7 +61,7 @@ export GRAPHITE_TARBALL := 3069842a88b8f40c6b83ad2850cda293-graphite2-minimal-1. export HARFBUZZ_MD5SUM := 5986e1bfcd983d1f6caa53ef64c4abc5 export HARFBUZZ_TARBALL := harfbuzz-1.3.2.tar.bz2 export HSQLDB_TARBALL := 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip -export HUNSPELL_TARBALL := 33d370f7fe5a030985e445a5672b2067-hunspell-1.4.1.tar.gz +export HUNSPELL_TARBALL := 9849a2381bacbeb2714034ad825bede8-hunspell-1.5.4.tar.gz export HYPHEN_TARBALL := 5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-2.8.8.tar.gz export ICU_TARBALL := 1901302aaff1c1633ef81862663d2917-icu4c-58_1-src.tgz export JFREEREPORT_FLOW_ENGINE_TARBALL := ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip diff --git a/external/hunspell/UnpackedTarball_hunspell.mk b/external/hunspell/UnpackedTarball_hunspell.mk index e70e33f37911..127ca5d8a0b1 100644 --- a/external/hunspell/UnpackedTarball_hunspell.mk +++ b/external/hunspell/UnpackedTarball_hunspell.mk @@ -11,11 +11,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,hunspell)) $(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL))) -$(eval $(call gb_UnpackedTarball_add_patches,hunspell,\ - external/hunspell/hunspell-solaris.patch \ - external/hunspell/hunspell-windows.patch \ -)) - ifeq ($(COM),MSC) $(eval $(call gb_UnpackedTarball_set_post_action,hunspell,\ touch src/hunspell/config.h \ diff --git a/external/hunspell/hunspell-solaris.patch b/external/hunspell/hunspell-solaris.patch deleted file mode 100644 index b07bbb254c3f..000000000000 --- a/external/hunspell/hunspell-solaris.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- misc/hunspell-1.3.2.orig/src/tools/hunspell.cxx 2010-02-27 23:42:05.000000000 +0000 -+++ misc/build/hunspell-1.3.2/src/tools/hunspell.cxx 2010-02-27 23:43:02.000000000 +0000 -@@ -10,6 +10,9 @@ - #include "hunspell.hxx" - #include "csutil.hxx" - -+// switch off iconv support for tests (fixing Solaris problems) -+#undef HAVE_ICONV -+ - #ifndef HUNSPELL_EXTRA - #define suggest_auto suggest - #endif diff --git a/external/hunspell/hunspell-windows.patch b/external/hunspell/hunspell-windows.patch deleted file mode 100644 index 357272d17c00..000000000000 --- a/external/hunspell/hunspell-windows.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- /dev/null 2016-03-15 09:11:25.292954614 +0000 -+++ misc/hunspell-1.3.4/src/hunspell/hunvisapi.h 2016-04-06 16:40:47.181698825 +0100 -@@ -0,0 +1,18 @@ -+#ifndef _HUNSPELL_VISIBILITY_H_ -+#define _HUNSPELL_VISIBILITY_H_ -+ -+#if defined(HUNSPELL_STATIC) -+# define LIBHUNSPELL_DLL_EXPORTED -+#elif defined(_MSC_VER) -+# if defined(BUILDING_LIBHUNSPELL) -+# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport) -+# else -+# define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport) -+# endif -+#elif defined(BUILDING_LIBHUNSPELL) && 1 -+# define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default"))) -+#else -+# define LIBHUNSPELL_DLL_EXPORTED -+#endif -+ -+#endif diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index dadf485ddbdb..173426f019f4 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -270,8 +270,11 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale) return bRes; } -sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocale ) +sal_Int16 SpellChecker::GetSpellFailure(const OUString &rWord, const Locale &rLocale) { + if (rWord.getLength() > MAXWORDLEN) + return -1; + Hunspell * pMS = nullptr; rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW; @@ -334,7 +337,11 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL #endif aDicts[i] = new Hunspell(aTmpaff.getStr(),aTmpdict.getStr()); +#if defined(H_DEPRECATED) + aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dict_encoding().c_str()); +#else aDEncs[i] = getTextEncodingFromCharset(aDicts[i]->get_dic_encoding()); +#endif } pMS = aDicts[i]; eEnc = aDEncs[i]; @@ -351,8 +358,12 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL return -1; OString aWrd(OU2ENC(nWord,eEnc)); - int rVal = pMS->spell(aWrd.getStr()); - if (rVal != 1) { +#if defined(H_DEPRECATED) + bool bVal = pMS->spell(std::string(aWrd.getStr())); +#else + bool bVal = pMS->spell(aWrd.getStr()) != 0; +#endif + if (!bVal) { if (extrachar && (eEnc != RTL_TEXTENCODING_UTF8)) { OUStringBuffer aBuf(nWord); n = aBuf.getLength(); @@ -370,8 +381,12 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL } OUString aWord(aBuf.makeStringAndClear()); OString bWrd(OU2ENC(aWord, eEnc)); - rVal = pMS->spell(bWrd.getStr()); - if (rVal == 1) return -1; +#if defined(H_DEPRECATED) + bVal = pMS->spell(std::string(bWrd.getStr())); +#else + bVal = pMS->spell(bWrd.getStr()) != 0; +#endif + if (bVal) return -1; } nRes = SpellFailure::SPELLING_ERROR; } else { @@ -470,10 +485,23 @@ Reference< XSpellAlternatives > if (pMS) { - char ** suglst = nullptr; OString aWrd(OU2ENC(nWord,eEnc)); +#if defined(H_DEPRECATED) + std::vector<std::string> suglst = pMS->suggest(std::string(aWrd.getStr())); + if (!suglst.empty()) + { + aStr.realloc(numsug + suglst.size()); + OUString *pStr = aStr.getArray(); + for (size_t ii = 0; ii < suglst.size(); ++ii) + { + OUString cvtwrd(suglst[ii].c_str(), suglst[ii].size(), eEnc); + pStr[numsug + ii] = cvtwrd; + } + numsug += suglst.size(); + } +#else + char ** suglst = nullptr; int count = pMS->suggest(&suglst, aWrd.getStr()); - if (count) { aStr.realloc( numsug + count ); @@ -485,8 +513,8 @@ Reference< XSpellAlternatives > } numsug += count; } - pMS->free_list(&suglst, count); +#endif } } |