diff options
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.cxx | 8 | ||||
-rw-r--r-- | lingucomponent/source/lingutil/lingutil.hxx | 5 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index c0ef851f46a2..ab2244ba8ef7 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 f5f1d76356c8..5319661399c5 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 1809efe96b95..cf3d26f7afa7 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())); |