external/hunspell/hunspell-fdo48017-wfopen.patch | 9 +++++++-- lingucomponent/source/lingutil/lingutil.cxx | 8 ++++++++ lingucomponent/source/lingutil/lingutil.hxx | 5 +++++ lingucomponent/source/spellcheck/spell/sspellimp.cxx | 4 ++-- 4 files changed, 22 insertions(+), 4 deletions(-)
New commits: commit 723198a9f7b7483c9366b06cedc8cfa6079efe25 Author: László Németh <nem...@numbertext.org> Date: Tue Jul 22 19:26:31 2014 +0200 fdo#80363 backport of the fix for Cyrillic spell. dictionary path (LibreOffice 4.2.5 has problem only with the spelling dictionary path, this bug doesn't affect hyphenation dictionaries and thesauri here). Change-Id: I85f423a647f0f1765440287fbe4e9add9d740d83 Reviewed-on: https://gerrit.libreoffice.org/10471 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch b/external/hunspell/hunspell-fdo48017-wfopen.patch index 47b803b..37203be 100644 --- a/external/hunspell/hunspell-fdo48017-wfopen.patch +++ b/external/hunspell/hunspell-fdo48017-wfopen.patch @@ -13,7 +13,7 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx #ifdef OPENOFFICEORG # include <unicode/uchar.h> #else -@@ -46,6 +50,21 @@ +@@ -51,6 +51,26 @@ static struct unicode_info2 * utf_tbl = NULL; static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances @@ -23,9 +23,14 @@ diff -ru hunspell/src/hunspell/csutil.cxx build/hunspell/src/hunspell/csutil.cxx + if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) { + int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0); + wchar_t *buff = (wchar_t *) malloc(len * sizeof(wchar_t)); ++ wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t)); ++ FILE * f = NULL; + MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len); -+ FILE * f = _wfopen(buff, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); ++ if (_wfullpath( buff2, buff, len ) != NULL) { ++ f = _wfopen(buff2, (strcmp(mode, "r") == 0) ? L"r" : L"rb"); ++ } + free(buff); ++ free(buff2); + return f; + } +#endif diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index c0ef851..ab2244b 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -48,6 +48,14 @@ using ::com::sun::star::lang::Locale; using namespace ::com::sun::star; #if defined(WNT) + +OString Win_AddLongPathPrefix( const OString &rPathName ) +{ +#define WIN32_LONG_PATH_PREFIX "\\\\?\\" + if (!rPathName.match(WIN32_LONG_PATH_PREFIX)) return WIN32_LONG_PATH_PREFIX + rPathName; + return rPathName; +} + OString Win_GetShortPathName( const OUString &rLongPathName ) { OString aRes; diff --git a/lingucomponent/source/lingutil/lingutil.hxx b/lingucomponent/source/lingutil/lingutil.hxx index f5f1d76..5319661 100644 --- a/lingucomponent/source/lingutil/lingutil.hxx +++ b/lingucomponent/source/lingutil/lingutil.hxx @@ -54,6 +54,11 @@ inline sal_Bool operator == ( const ::com::sun::star::lang::Locale &rL1, const : } #if defined(WNT) + +// to be use to get a path name with long path prefix +// under Windows for Hunspell +OString Win_AddLongPathPrefix( const OString &rPathName ); + /////////////////////////////////////////////////////////////////////////// // to be use to get a short path name under Windows that still can be used with // the 'fopen' call. This is necessary since under Windows there seems to be diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 1809efe..cf3d26f 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -315,8 +315,8 @@ sal_Int16 SpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rL // about 120+ characters which will usually be exceed when // using dictionaries as extensions. (Hunspell waits UTF-8 encoded // path with \\?\ long path prefix.) - OString aTmpaff = OUStringToOString(aff, RTL_TEXTENCODING_UTF8); - OString aTmpdict = OUStringToOString(dict, RTL_TEXTENCODING_UTF8); + OString aTmpaff = Win_AddLongPathPrefix(OUStringToOString(aff, RTL_TEXTENCODING_UTF8)); + OString aTmpdict = Win_AddLongPathPrefix(OUStringToOString(dict, RTL_TEXTENCODING_UTF8)); #else OString aTmpaff(OU2ENC(aff,osl_getThreadTextEncoding())); OString aTmpdict(OU2ENC(dict,osl_getThreadTextEncoding()));
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits