[Libreoffice-commits] core.git: 2 commits - lingucomponent/source

David Tardon dtardon at redhat.com
Thu Dec 15 09:41:01 UTC 2016


 lingucomponent/source/spellcheck/spell/sspellimp.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 043c1886d559b58cc8948b0543b656a9039c8197
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Dec 15 10:37:03 2016 +0100

    hunspell defines this for some time now
    
    Change-Id: I5cd3cd11f24bee87266822ec13e64132ee470d6a

diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 41e6e8d..c09f7a4 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -58,7 +58,9 @@ using namespace com::sun::star::linguistic2;
 using namespace linguistic;
 
 // XML-header of SPELLML queries
-#define SPELLML_HEADER "<?xml?>"
+#if defined SPELL_XML
+#define SPELL_XML "<?xml?>"
+#endif
 
 // only available in hunspell >= 1.5
 #if !defined MAXWORDLEN
@@ -422,7 +424,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL
         return true;
 
     // return sal_False to process SPELLML requests (they are longer than the header)
-    if (rWord.match(SPELLML_HEADER, 0) && (rWord.getLength() > 10)) return false;
+    if (rWord.match(SPELL_XML, 0) && (rWord.getLength() > 10)) return false;
 
     // Get property values to be used.
     // These are be the default values set in the SN_LINGU_PROPERTIES
@@ -434,7 +436,7 @@ sal_Bool SAL_CALL SpellChecker::isValid( const OUString& rWord, const Locale& rL
     rHelper.SetTmpPropVals( rProperties );
 
     sal_Int16 nFailure = GetSpellFailure( rWord, rLocale );
-    if (nFailure != -1 && !rWord.match(SPELLML_HEADER, 0))
+    if (nFailure != -1 && !rWord.match(SPELL_XML, 0))
     {
         sal_Int16 nLang = LinguLocaleToLanguage( rLocale );
         // postprocess result for errors that should be ignored
commit 64362ec119a4f38c98d2ff959a5651f4887ff942
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Dec 15 10:36:18 2016 +0100

    fix build with hunspell < 1.5
    
    Change-Id: I66810d2bf9bbd08990dd8e995e34c50caa472ff8

diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 5a1abd7..41e6e8d 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -60,6 +60,11 @@ using namespace linguistic;
 // XML-header of SPELLML queries
 #define SPELLML_HEADER "<?xml?>"
 
+// only available in hunspell >= 1.5
+#if !defined MAXWORDLEN
+#define MAXWORDLEN 176
+#endif
+
 SpellChecker::SpellChecker() :
     aDicts(nullptr),
     aDEncs(nullptr),


More information about the Libreoffice-commits mailing list