[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - lingucomponent/source

László Németh nemeth at numbertext.org
Wed Jul 16 03:06:36 PDT 2014


 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |    2 +-
 lingucomponent/source/lingutil/lingutil.cxx           |   13 +++++++++++++
 lingucomponent/source/lingutil/lingutil.hxx           |    8 ++++++++
 lingucomponent/source/spellcheck/spell/sspellimp.cxx  |    4 ++--
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx   |    4 ++--
 5 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit 5536b127a105123de6f64dcf8f53dfa277faef3c
Author: László Németh <nemeth at numbertext.org>
Date:   Tue Jul 15 14:11:34 2014 +0200

    fdo#80363 always use WIN32 long path prefix with Hunspell, MyThes, Hyphen
    
    Change-Id: I738401babffd38c241ef16e23d1b246444fd8d55
    Reviewed-on: https://gerrit.libreoffice.org/10328
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 72fd23d..b8b9979 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 769a023..c384a5b 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 bda6de1..a54832c 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 8881816..078f9da 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 73d0542..994f28a 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()));


More information about the Libreoffice-commits mailing list