summaryrefslogtreecommitdiff
path: root/lingucomponent/source
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2014-07-15 14:11:34 +0200
committerLászló Németh <nemeth@numbertext.org>2014-07-15 14:25:58 +0200
commitea9331fd4955fe6fad0957ee6240275148353e32 (patch)
treed9c6686f39eea3f7ffa99922ba326c36da8b847e /lingucomponent/source
parent65ecb0d8f43f99f3794fe1aa19c87c153534fbf2 (diff)
fdo#80363 always use WIN32 long path prefix with Hunspell, MyThes, Hyphen
Change-Id: I738401babffd38c241ef16e23d1b246444fd8d55
Diffstat (limited to 'lingucomponent/source')
-rw-r--r--lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx2
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx13
-rw-r--r--lingucomponent/source/lingutil/lingutil.hxx8
-rw-r--r--lingucomponent/source/spellcheck/spell/sspellimp.cxx4
-rw-r--r--lingucomponent/source/thesaurus/libnth/nthesimp.cxx4
5 files changed, 26 insertions, 5 deletions
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 72fd23d839f1..b8b997931a26 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -293,7 +293,7 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo
#if defined(WNT)
// Hyphen waits UTF-8 encoded paths with \\?\ long path prefix.
- OString sTmp = OUStringToOString(dictpath, RTL_TEXTENCODING_UTF8);
+ OString sTmp = Win_AddLongPathPrefix(OUStringToOString(dictpath, RTL_TEXTENCODING_UTF8));
#else
OString sTmp( OU2ENC( dictpath, osl_getThreadTextEncoding() ) );
#endif
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index 769a023c9096..c384a5beca0b 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#if defined(WNT)
+#include <windows.h>
+#endif
+
#include <osl/thread.h>
#include <osl/file.hxx>
#include <tools/debug.hxx>
@@ -41,6 +45,15 @@
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;
+}
+#endif //defined(WNT)
+
// build list of old style diuctionaries (not as extensions) to use.
// User installed dictionaries (the ones residing in the user paths)
// will get precedence over system installed ones for the same language.
diff --git a/lingucomponent/source/lingutil/lingutil.hxx b/lingucomponent/source/lingutil/lingutil.hxx
index bda6de1a7432..a54832c4e482 100644
--- a/lingucomponent/source/lingutil/lingutil.hxx
+++ b/lingucomponent/source/lingutil/lingutil.hxx
@@ -48,6 +48,14 @@ inline bool operator == ( const ::com::sun::star::lang::Locale &rL1, const ::com
rL1.Variant == rL2.Variant;
}
+#if defined(WNT)
+
+// to be use to get a path name with long path prefix
+// under Windows for Hunspell, Hyphen and MyThes libraries
+OString Win_AddLongPathPrefix( const OString &rPathName );
+#endif
+
+
// temporary function, to be removed when new style dictionaries
// using configuration entries are fully implemented and provided
std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char * pDicType );
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 888181616958..078f9da2bd09 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -306,8 +306,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()));
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 73d05426e8c3..994f28a14245 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -331,8 +331,8 @@ Sequence < Reference < ::com::sun::star::linguistic2::XMeaning > > SAL_CALL Thes
#if defined(WNT)
// MyThes waits UTF-8 encoded paths with \\?\ long path prefix.
- OString aTmpidx = OUStringToOString(nidx, RTL_TEXTENCODING_UTF8);
- OString aTmpdat = OUStringToOString(ndat, RTL_TEXTENCODING_UTF8);
+ OString aTmpidx = Win_AddLongPathPrefix(OUStringToOString(nidx, RTL_TEXTENCODING_UTF8));
+ OString aTmpdat = Win_AddLongPathPrefix(OUStringToOString(ndat, RTL_TEXTENCODING_UTF8));
#else
OString aTmpidx(OU2ENC(nidx,osl_getThreadTextEncoding()));
OString aTmpdat(OU2ENC(ndat,osl_getThreadTextEncoding()));