[Libreoffice-commits] core.git: external/hunspell

2023-11-03 Thread Noel Grandin (via logerrit)
 external/hunspell/UnpackedTarball_hunspell.mk |1 
 external/hunspell/clock-monotonic.patch.1 |  105 ++
 2 files changed, 106 insertions(+)

New commits:
commit afd635082e4d06832877f70b7da9b187a6b21fbc
Author: Noel Grandin 
AuthorDate: Fri Nov 3 11:16:42 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Nov 3 15:22:51 2023 +0100

speed up hunspell inner loop

which calls into the kernel to get elapsed time, instead of using the
VDSO-based CLOCK_MONOTONIC (or at least, the C++ equivalent of that)
, which is much faster

Change-Id: I99d958b0ab64b75360db4e0c8a951c37af2505bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158809
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 9075d98659e7..0d5986798265 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \

external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
 \

external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
 \
external/hunspell/bit_cast.patch.0 \
+   external/hunspell/clock-monotonic.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/clock-monotonic.patch.1 
b/external/hunspell/clock-monotonic.patch.1
new file mode 100644
index ..dd873f6c3908
--- /dev/null
+++ b/external/hunspell/clock-monotonic.patch.1
@@ -0,0 +1,105 @@
+From 5737bdb3d7e5819528e33c360a73372e0e93a6be Mon Sep 17 00:00:00 2001
+From: Noel Grandin 
+Date: Fri, 3 Nov 2023 12:04:30 +
+Subject: [PATCH] speed up hunspell inner loop
+
+which calls into the kernel to get elapsed time, instead of using the
+VDSO-based CLOCK_MONOTONIC (or at least, the C++ equivalent of that),
+which is much faster
+
+https://gerrit.libreoffice.org/c/core/+/158809
+---
+ src/hunspell/affixmgr.cxx | 43 +++
+ 1 file changed, 25 insertions(+), 18 deletions(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 2cad09f..a3c93cd 100644
+--- a/src/hunspell/affixmgr.cxx
 b/src/hunspell/affixmgr.cxx
+@@ -75,6 +75,7 @@
+ #include 
+ 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+@@ -1590,17 +1591,20 @@ struct hentry* AffixMgr::compound_check(const 
std::string& word,
+   // add a time limit to handle possible
+   // combinatorical explosion of the overlapping words
+ 
+-  HUNSPELL_THREAD_LOCAL clock_t timelimit;
++  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point 
clock_time_start;
++  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
++
++  // get the current time
++  std::chrono::steady_clock::time_point clock_now = 
std::chrono::steady_clock::now();
+ 
+   if (wordnum == 0) {
+-  // get the start time, seeing as we're reusing this set to 0
+-  // to flag timeout, use clock() + 1 to avoid start clock()
+-  // of 0 as being a timeout
+-  timelimit = clock() + 1;
+-  }
+-  else if (timelimit != 0 && (clock() > timelimit + TIMELIMIT)) {
+-  timelimit = 0;
++  // set the start time
++  clock_time_start = clock_now;
++  timelimit_exceeded = false;
+   }
++  else if (std::chrono::duration_cast(clock_now - 
clock_time_start).count()
++> TIMELIMIT * CLOCKS_PER_SEC * 1000)
++  timelimit_exceeded = true;
+ 
+   setcminmax(, , word.c_str(), len);
+ 
+@@ -1626,7 +1630,7 @@ struct hentry* AffixMgr::compound_check(const 
std::string& word,
+ 
+   do {  // simplified checkcompoundpattern loop
+ 
+-if (timelimit == 0)
++if (timelimit_exceeded)
+   return 0;
+ 
+ if (scpd > 0) {
+@@ -2216,17 +2220,20 @@ int AffixMgr::compound_check_morph(const std::string& 
word,
+   // add a time limit to handle possible
+   // combinatorical explosion of the overlapping words
+ 
+-  HUNSPELL_THREAD_LOCAL clock_t timelimit;
++  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point 
clock_time_start;
++  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
++
++  // get the current time
++  std::chrono::steady_clock::time_point clock_now = 
std::chrono::steady_clock::now();
+ 
+   if (wordnum == 0) {
+-  // get the start time, seeing as we're reusing this set to 0
+-  // to flag timeout, use clock() + 1 to avoid start clock()
+-  // of 0 as being a timeout
+-  timelimit = clock() + 1;
+-  }
+-  else if (timelimit != 0 && (clock() > timelimit + TIMELIMIT)) {
+-  timelimit = 0;
++  // set the start time
++  clock_time_start = clock_now;
++  timelimit_exceeded = false;
+   }
++  else if (std::chrono::duration_cast(clock_now - 
clock_time_start).count()
++> TIMELIMIT * CLOCKS_PER_SEC * 1000)
++  timelimit_exceeded = true;
+ 
+   setcminmax(, , word.c_str(), 

[Libreoffice-commits] core.git: external/hunspell

2023-08-04 Thread Stephan Bergmann (via logerrit)
 external/hunspell/UnpackedTarball_hunspell.mk |1 +
 external/hunspell/bit_cast.patch.0|   22 ++
 2 files changed, 23 insertions(+)

New commits:
commit ed5d9496320d78032ab4a65fc5547aad069d19f2
Author: Stephan Bergmann 
AuthorDate: Fri Aug 4 14:06:06 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Aug 4 20:28:03 2023 +0200

external/hunspell: Work around missing C++20 std::bit_cast

...as witnessed with 

on top of patch set 4 of 
"Bump baseline to C++20",

> In file included from 
/home/tdf/lode/jenkins/workspace/android_x86/lingucomponent/source/spellcheck/spell/sspellimp.cxx:35:
> In file included from 
/home/tdf/lode/jenkins/workspace/android_x86/workdir/UnpackedTarball/hunspell/src/hunspell/hunspell.hxx:74:
> 
/home/tdf/lode/jenkins/workspace/android_x86/workdir/UnpackedTarball/hunspell/src/hunspell/w_char.hxx:62:17:
 error: no member named 'bit_cast' in namespace 'std'
> return std::bit_cast(*this);
>~^

Change-Id: Ic4a799a0918ff6bcc4dd414d5ae59e02181074bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155346
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 9da05b966b4e..9075d98659e7 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \

external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch
 \

external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
 \

external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
 \
+   external/hunspell/bit_cast.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/bit_cast.patch.0 
b/external/hunspell/bit_cast.patch.0
new file mode 100644
index ..777b9bbfdd8e
--- /dev/null
+++ b/external/hunspell/bit_cast.patch.0
@@ -0,0 +1,22 @@
+--- src/hunspell/w_char.hxx
 src/hunspell/w_char.hxx
+@@ -42,9 +42,8 @@
+ 
+ #if __cplusplus >= 202002L
+ #include 
+-#else
++#endif
+ #include 
+-#endif
+ 
+ #ifndef GCC
+ struct w_char {
+@@ -58,7 +57,7 @@
+   {
+ #if defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
+ //use little-endian optimized version
+-#if __cplusplus >= 202002L
++#if __cplusplus >= 202002L && defined __cpp_lib_bit_cast && 
__cpp_lib_bit_cast >= 201806L
+ return std::bit_cast(*this);
+ #else
+ unsigned short u;


[Libreoffice-commits] core.git: external/hunspell

2023-05-17 Thread László Németh (via logerrit)
 
external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
 |  149 ++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |1 
 2 files changed, 150 insertions(+)

New commits:
commit ad7a84e41b50e6221634307112f00baf2b549dcd
Author: László Németh 
AuthorDate: Wed May 17 10:33:30 2023 +0200
Commit: László Németh 
CommitDate: Wed May 17 20:06:18 2023 +0200

tdf#92824 spell checking: limit suggestions only for the best ones

Apply Hunspell fix to keep only the best suggestions, if they
exist to avoid of overgenerating worse suggestions especially
for short bad words.

See Hunspell commit b88f9ea57bdb9b219f3c1d2c67f4f882f1f23194
"Keep only REP, ph: or 2-word dictionary phrase suggestions

These are the best suggestions, no need to search other
ones to avoid annoying redundant and long list.

For example to suggest only "a lot" to the bad form "alot",
add the 2-word phrase "a lot" to the dic file.

Or for a very typical spelling mistake, enough to specify the
bad form with a ph: in the dictionary file to remove the other
suggestions."

Change-Id: I0272bb9ed2dd493aa372feb68d1937e359910e0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151868
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git 
a/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
 
b/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
new file mode 100644
index ..2e903a34e42a
--- /dev/null
+++ 
b/external/hunspell/0001-Keep-only-REP-ph-or-2-word-dictionary-phrase-suggest.patch
@@ -0,0 +1,149 @@
+From b88f9ea57bdb9b219f3c1d2c67f4f882f1f23194 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= 
+Date: Sun, 14 May 2023 22:15:15 +0200
+Subject: [PATCH] Keep only REP, ph: or 2-word dictionary phrase suggestions
+
+These are the best suggestions, no need to search other
+ones to avoid annoying redundant and long list.
+
+For example to suggest only "a lot" to the bad form "alot",
+add the 2-word phrase "a lot" to the dic file.
+
+Or for a very typical spelling mistake, enough to specify the
+bad form with a ph: in the dictionary file to remove the other
+suggestions.
+
+Note: partial revert of commit de9fe28008eb0761c33bd83847f282602c599fda
+"fix up some warnings seen with -Wall -Wextra".
+---
+ src/hunspell/atypes.hxx |  1 +
+ src/hunspell/suggestmgr.cxx | 31 ++-
+ src/hunspell/suggestmgr.hxx |  2 +-
+ tests/ph.sug|  4 ++--
+ tests/rep.sug   |  2 +-
+ 5 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/src/hunspell/atypes.hxx b/src/hunspell/atypes.hxx
+index 7e5a5c0..6e3ed1b 100644
+--- a/src/hunspell/atypes.hxx
 b/src/hunspell/atypes.hxx
+@@ -82,6 +82,7 @@ static inline void HUNSPELL_WARNING(FILE*, const char*, ...) 
{}
+ #define SPELL_ORIGCAP (1 << 5)
+ #define SPELL_WARN (1 << 6)
+ #define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the 
compound
++#define SPELL_BEST_SUG (1 << 8)// limit suggestions for the best ones, 
i.e. ph:
+ 
+ #define MINCPDLEN 3
+ #define MAXCOMPOUND 10
+diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
+index 19a24f8..ba688aa 100644
+--- a/src/hunspell/suggestmgr.cxx
 b/src/hunspell/suggestmgr.cxx
+@@ -242,8 +242,11 @@ bool SuggestMgr::suggest(std::vector& slst,
+ if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + 
maxcpdsugs))) {
+   size_t i = slst.size();
+   replchars(slst, word, cpdsuggest, info);
+-  if (slst.size() > i)
++  if (slst.size() > i) {
+ good_suggestion = true;
++if (info & SPELL_BEST_SUG)
++  return true;
++  }
+ }
+ if (clock() > timelimit + TIMELIMIT_SUGGESTION)
+   return good_suggestion;
+@@ -365,7 +368,10 @@ bool SuggestMgr::suggest(std::vector& slst,
+ // we always suggest them, in despite of nosplitsugs, and
+ // drop compound word and other suggestions)
+ if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
+-  good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, 
info);
++  good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, 
info);
++
++  if (info & SPELL_BEST_SUG)
++return true;
+ }
+ if (clock() > timelimit + TIMELIMIT_SUGGESTION)
+   return good_suggestion;
+@@ -506,15 +512,23 @@ int SuggestMgr::replchars(std::vector& wlst,
+   candidate.assign(word, 0, r);
+   candidate.append(entry.outstrings[type]);
+   candidate.append(word, r + entry.pattern.size(), std::string::npos);
++  size_t sp = candidate.find(' ');
++  size_t oldns = wlst.size();
+   testsug(wlst, candidate, cpdsuggest, NULL, NULL, info);
++  if (oldns < wlst.size()) {
++int patlen = entry.pattern.size();
++int replen 

[Libreoffice-commits] core.git: external/hunspell

2023-01-07 Thread Caolán McNamara (via logerrit)
 
external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
 |   77 ++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |1 
 2 files changed, 78 insertions(+)

New commits:
commit 2a8660c6d36a2015c37c65b6bc21c6decd96cf8e
Author: Caolán McNamara 
AuthorDate: Fri Jan 6 16:28:03 2023 +
Commit: Caolán McNamara 
CommitDate: Sat Jan 7 10:57:04 2023 +

Related: rhbz#2158548 allow longer words for hunspell-ko

https://github.com/hunspell/hunspell/issues/903

A problem since the sanity check added in:

commit 05e44e069e4cfaa9ce1264bf13f23fc9abd7ed05
Author: Caolán McNamara 
Date:   Thu Sep 1 13:46:40 2022 +0100

Check word limit (#813)

* check against hentry blen max

Change-Id: Iab2c062584da076260c3262537690435eae7f396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145154
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
 
b/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
new file mode 100644
index ..c0225fbd70a4
--- /dev/null
+++ 
b/external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
@@ -0,0 +1,77 @@
+From e2fe9f86e1769b440972971240e9b8fb1cd53b97 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Fri, 6 Jan 2023 16:20:45 +
+Subject: [PATCH] Resolves: rhbz#2158548 allow longer words for hunspell-ko
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+https://github.com/hunspell/hunspell/issues/903
+
+A problem since the sanity check added in:
+
+commit 05e44e069e4cfaa9ce1264bf13f23fc9abd7ed05
+Author: Caolán McNamara 
+Date:   Thu Sep 1 13:46:40 2022 +0100
+
+Check word limit (#813)
+
+* check against hentry blen max
+---
+ src/hunspell/hashmgr.cxx | 6 +++---
+ src/hunspell/htypes.hxx  | 4 ++--
+ tests/korean.dic | 3 ++-
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx
+index 100916d..14201e9 100644
+--- a/src/hunspell/hashmgr.cxx
 b/src/hunspell/hashmgr.cxx
+@@ -209,7 +209,7 @@ int HashMgr::add_word(const std::string& in_word,
+   }
+ 
+   // limit of hp->blen
+-  if (word->size() > std::numeric_limits::max()) {
++  if (word->size() > std::numeric_limits::max()) {
+ HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", 
word->size());
+ delete desc_copy;
+ delete word_copy;
+@@ -235,8 +235,8 @@ int HashMgr::add_word(const std::string& in_word,
+ 
+   int i = hash(hpw, word->size());
+ 
+-  hp->blen = (unsigned char)word->size();
+-  hp->clen = (unsigned char)wcl;
++  hp->blen = (unsigned short)word->size();
++  hp->clen = (unsigned short)wcl;
+   hp->alen = (short)al;
+   hp->astr = aff;
+   hp->next = NULL;
+diff --git a/src/hunspell/htypes.hxx b/src/hunspell/htypes.hxx
+index 44366b1..2b896fb 100644
+--- a/src/hunspell/htypes.hxx
 b/src/hunspell/htypes.hxx
+@@ -62,8 +62,8 @@
+ #endif
+ 
+ struct hentry {
+-  unsigned char blen;// word length in bytes
+-  unsigned char clen;// word length in characters (different for UTF-8 
enc.)
++  unsigned short blen;   // word length in bytes
++  unsigned short clen;   // word length in characters (different for UTF-8 
enc.)
+   short alen;// length of affix flag vector
+   unsigned short* astr;  // affix flag vector
+   struct hentry* next;   // next word with same hash code
+diff --git a/tests/korean.dic b/tests/korean.dic
+index 95cb450..d76ea05 100644
+--- a/tests/korean.dic
 b/tests/korean.dic
+@@ -1,3 +1,4 @@
+-2
++3
+ 들어오세요
+ 안녕하세요
++김수한무거북이와두루미삼천갑자동방삭치치카포사리사리세ᅡ워리워리세브리캉무드셀ᅡ구름위허ᅵ케ᅵᆫᅦ담벼락서생원에ᄀ양
+-- 
+2.38.1
+
diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 2b8823021998..4667a3642bcc 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,hunspell,1))
 
 $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \

external/hunspell/0001-fix-LibreOffice-build-problem-with-basic_string-appe.patch
 \
+   
external/hunspell/0001-Resolves-rhbz-2158548-allow-longer-words-for-hunspel.patch
 \
 ))
 
 # vim: set noet sw=4 ts=4:


[Libreoffice-commits] core.git: external/hunspell

2022-08-23 Thread Caolán McNamara (via logerrit)
 
external/hunspell/0001-check-len-in-cpdpat_check-like-r1-blen-is-checked-63.patch
 |   27 +
 external/hunspell/0001-improve-630-test-case-from-0m1.836s-0m1.223s-785.patch  
   |   52 ++
 external/hunspell/0001-improve-630-test-case-from-0m2.427s-0m1.836s-781.patch  
   |   40 +++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |3 
 4 files changed, 122 insertions(+)

New commits:
commit 9fda7a0c938fdae3e57c7a8121a94459f2749dc2
Author: Caolán McNamara 
AuthorDate: Tue Aug 23 15:25:54 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 23 17:32:51 2022 +0200

backport some upstream hunspell commits

Change-Id: I0c2b94a27af8c25c69579b367b944a4f77036487
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138735
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git 
a/external/hunspell/0001-check-len-in-cpdpat_check-like-r1-blen-is-checked-63.patch
 
b/external/hunspell/0001-check-len-in-cpdpat_check-like-r1-blen-is-checked-63.patch
new file mode 100644
index ..58b68d0dda43
--- /dev/null
+++ 
b/external/hunspell/0001-check-len-in-cpdpat_check-like-r1-blen-is-checked-63.patch
@@ -0,0 +1,27 @@
+From 56ad6310c95695d25f936d3f89f6ee3d787df274 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Mon, 22 Aug 2022 21:21:36 +0100
+Subject: [PATCH] check 'len' in cpdpat_check like 'r1->blen' is checked (#633)
+ (#780)
+
+we should check len against pos like we do r1->blen in the line above
+---
+ src/hunspell/affixmgr.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 7ea1ea5..c2432c0 100644
+--- a/src/hunspell/affixmgr.cxx
 b/src/hunspell/affixmgr.cxx
+@@ -1330,7 +1330,7 @@ int AffixMgr::cpdpat_check(const char* word,
+  ((checkcpdtable[i].pattern[0] == '0' && r1->blen <= pos &&
+strncmp(word + pos - r1->blen, r1->word, r1->blen) == 0) ||
+   (checkcpdtable[i].pattern[0] != '0' &&
+-   ((len = checkcpdtable[i].pattern.size()) != 0) &&
++   ((len = checkcpdtable[i].pattern.size()) != 0) && len <= pos &&
+strncmp(word + pos - len, checkcpdtable[i].pattern.c_str(), len) 
== 0 {
+   return 1;
+ }
+-- 
+2.37.2
+
diff --git 
a/external/hunspell/0001-improve-630-test-case-from-0m1.836s-0m1.223s-785.patch 
b/external/hunspell/0001-improve-630-test-case-from-0m1.836s-0m1.223s-785.patch
new file mode 100644
index ..a42d38f5153a
--- /dev/null
+++ 
b/external/hunspell/0001-improve-630-test-case-from-0m1.836s-0m1.223s-785.patch
@@ -0,0 +1,52 @@
+From 75ebf084f941c0fe72904b6167079d9190f885e5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Tue, 23 Aug 2022 11:44:36 +0100
+Subject: [PATCH] improve #630 test case from 0m1.836s -> 0m1.223s (#785)
+
+---
+ src/hunspell/csutil.cxx | 16 ++--
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/hunspell/csutil.cxx b/src/hunspell/csutil.cxx
+index e9cce47..5caa771 100644
+--- a/src/hunspell/csutil.cxx
 b/src/hunspell/csutil.cxx
+@@ -171,8 +171,10 @@ std::string& u16_u8(std::string& dest, const 
std::vector& src) {
+ }
+ 
+ int u8_u16(std::vector& dest, const std::string& src) {
+-  dest.clear();
+-  dest.reserve(src.size());
++  // faster to oversize initially, assign to elements and resize to what's 
used
++  // than to reserve and push_back
++  dest.resize(src.size());
++  std::vector::iterator u16 = dest.begin();
+   std::string::const_iterator u8 = src.begin();
+   std::string::const_iterator u8_max = src.end();
+ 
+@@ -254,16 +256,18 @@ int u8_u16(std::vector& dest, const std::string& 
src) {
+  src.c_str());
+ u2.h = 0xff;
+ u2.l = 0xfd;
+-dest.push_back(u2);
++*u16++ = u2;
++dest.resize(u16 - dest.begin());
+ return -1;
+   }
+ }
+-dest.push_back(u2);
++*u16++ = u2;
+ ++u8;
+   }
+ 
+-  dest.shrink_to_fit();
+-  return dest.size();
++  int size = u16 - dest.begin();
++  dest.resize(size);
++  return size;
+ }
+ 
+ namespace {
+-- 
+2.37.2
+
diff --git 
a/external/hunspell/0001-improve-630-test-case-from-0m2.427s-0m1.836s-781.patch 
b/external/hunspell/0001-improve-630-test-case-from-0m2.427s-0m1.836s-781.patch
new file mode 100644
index ..c3de49178ada
--- /dev/null
+++ 
b/external/hunspell/0001-improve-630-test-case-from-0m2.427s-0m1.836s-781.patch
@@ -0,0 +1,40 @@
+From 211e1e6f36756579b86fa12891af3e5843cd8907 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Tue, 23 Aug 2022 10:18:31 +0100
+Subject: [PATCH] improve #630 test case from 0m2.427s -> 0m1.836s (#781)
+
+---
+ src/hunspell/csutil.cxx | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/hunspell/csutil.cxx b/src/hunspell/csutil.cxx
+index fbaa768..e9cce47 100644
+--- a/src/hunspell/csutil.cxx
 b/src/hunspell/csutil.cxx
+@@ 

[Libreoffice-commits] core.git: external/hunspell

2021-10-13 Thread Luboš Luňák (via logerrit)
 external/hunspell/ExternalProject_hunspell.mk |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit ccf5162e448b4dc6b930ce0354a60253ff70fbc2
Author: Luboš Luňák 
AuthorDate: Wed Oct 13 01:41:33 2021 +0200
Commit: Luboš Luňák 
CommitDate: Wed Oct 13 11:07:25 2021 +0200

use LTO to build hunspell if LTO is enabled

Without this, LTO gcc build may fail while linking libmerged because
of an undefined reference to `std::string::append(char const*)',
which looks like a gcc bug because std::string should be a template,
but whatever, this makes it build.

Change-Id: I173cc0c773d5957a0c4a9cecc74c1ab33afad7db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123541
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index 91fd5c431ef8..51b693b06e08 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -21,6 +21,13 @@ hunspell_CPPFLAGS+=-D_GLIBCXX_DEBUG
 endif
 endif
 
+hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \
+   $(gb_EMSCRIPTEN_CPPFLAGS) \
+   $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+   $(if $(debug),$(gb_DEBUGINFO_FLAGS))
+
+hunspell_LDFLAGS:=$(gb_LTOFLAGS)
+
 $(call gb_ExternalProject_get_state_target,hunspell,build):
$(call gb_Trace_StartRange,hunspell,EXTERNAL)
$(call gb_ExternalProject_run,build,\
@@ -28,7 +35,8 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM))\
$(if $(filter 
AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
$(if 
$(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
-   CXXFLAGS="$(CXXFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if 
$(debug),$(gb_DEBUGINFO_FLAGS))" \
+   $(if 
$(hunspell_CXXFLAGS),CXXFLAGS='$(hunspell_CXXFLAGS)') \
+   $(if $(hunspell_LDFLAGS),LDFLAGS='$(hunspell_LDFLAGS)') 
\
&& cd src/hunspell && $(MAKE) \
)
$(call gb_Trace_EndRange,hunspell,EXTERNAL)


[Libreoffice-commits] core.git: external/hunspell

2019-11-13 Thread Caolán McNamara (via logerrit)
 external/hunspell/0001-invalid-read-memory-access-624.patch |   25 
 external/hunspell/UnpackedTarball_hunspell.mk   |1 
 2 files changed, 26 insertions(+)

New commits:
commit 26b7ff2b6cc4def8ff7b02e223961534ba88e654
Author: Caolán McNamara 
AuthorDate: Tue Nov 12 20:49:52 2019 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 13 09:55:10 2019 +0100

CVE-2019-16707

Change-Id: I69c4c31330fde135b6ff6c0c1c72f613f0cc4b1d
Reviewed-on: https://gerrit.libreoffice.org/82551
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/external/hunspell/0001-invalid-read-memory-access-624.patch 
b/external/hunspell/0001-invalid-read-memory-access-624.patch
new file mode 100644
index ..66b55e7555bd
--- /dev/null
+++ b/external/hunspell/0001-invalid-read-memory-access-624.patch
@@ -0,0 +1,25 @@
+From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Tue, 12 Nov 2019 20:03:15 +
+Subject: [PATCH] invalid read memory access #624
+
+---
+ src/hunspell/suggestmgr.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
+index dba084e..c23f165 100644
+--- a/src/hunspell/suggestmgr.cxx
 b/src/hunspell/suggestmgr.cxx
+@@ -2040,7 +2040,7 @@ int SuggestMgr::leftcommonsubstring(
+   int l2 = su2.size();
+   // decapitalize dictionary word
+   if (complexprefixes) {
+-if (su1[l1 - 1] == su2[l2 - 1])
++if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
+   return 1;
+   } else {
+ unsigned short idx = su2.empty() ? 0 : (su2[0].h << 8) + su2[0].l;
+-- 
+2.23.0
+
diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 37a2d196fbf5..1cd24e225868 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -22,6 +22,7 @@ endif
 $(eval $(call gb_UnpackedTarball_set_patchlevel,hunspell,1))
 
 $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \
+   external/hunspell/0001-invalid-read-memory-access-624.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: external/hunspell

2018-11-13 Thread Libreoffice Gerrit user
 external/hunspell/UnpackedTarball_hunspell.mk |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0a911b00c4f6056167ca198fb45bdff6178575cb
Author: Tor Lillqvist 
AuthorDate: Wed Nov 14 09:44:27 2018 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Nov 14 09:45:18 2018 +0200

We need gb_UnpackedTarball_update_autoconf_configs in order to recognize iOS

Change-Id: I0c8eafc15c3582f64989ed3eedc28e746713df01

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 1c6a86a89478..37a2d196fbf5 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -11,6 +11,8 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,hunspell))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
 
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,hunspell))
+
 ifeq ($(COM),MSC)
 $(eval $(call gb_UnpackedTarball_set_post_action,hunspell,\
touch src/hunspell/config.h \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2018-11-13 Thread Libreoffice Gerrit user
 external/hunspell/ExternalProject_hunspell.mk |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit afd4f48d164ca72a024159e0c6b7a49147351f64
Author: Christian Lohmaier 
AuthorDate: Tue Nov 13 13:26:02 2018 +0100
Commit: Christian Lohmaier 
CommitDate: Tue Nov 13 17:04:35 2018 +0100

hunspell: no need for autoreconf when not patching configure

Also fix some bitrot... The LIBS statement was only active for the
autoreconf call, while where it would have mattered is the configure
call itself. Since it was built wihout those for all the time, delete
it.

also no need for explicit shell call, as it is by default executed in a
shell.

also fix missing comma in if statement for ENABLE_OPTIMIZED.

Change-Id: I7ced587bcc3488f19100e89b5b02730b9dd86d5f
Reviewed-on: https://gerrit.libreoffice.org/63329
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index 6be11ebbf5b6..375092bf390a 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -23,14 +23,11 @@ endif
 
 $(call gb_ExternalProject_get_state_target,hunspell,build):
$(call gb_ExternalProject_run,build,\
-   $(if $(filter iOS MACOSX,$(OS)),ACLOCAL="aclocal -I 
$(SRCDIR)/m4/mac") \
-   LIBS="$(gb_STDLIBS) $(LIBS)" \
-   autoreconf && \
-   $(SHELL) ./configure --disable-shared --disable-nls --with-pic \
+   ./configure --disable-shared --disable-nls --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM))\
$(if $(filter 
AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
$(if 
$(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
-   CXXFLAGS="$(CXXFLAGS) $(if $(ENABLE_OPTIMIZED) 
$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if 
$(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CXXFLAGS))" \
+   CXXFLAGS="$(CXXFLAGS) $(if 
$(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if 
$(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CXXFLAGS))" \
&& cd src/hunspell && $(MAKE) \
)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2018-10-25 Thread Libreoffice Gerrit user
 
external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
 |   13 +-
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 749ef30c823e595f42e9844fb438441250389a0a
Author: Stephan Bergmann 
AuthorDate: Thu Oct 25 10:18:03 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 25 13:21:37 2018 +0200

Fix external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-...

...introduced with b691e5824a6346d2fe7f702b5280b56532a2f89e "tdf#118162 
spell
checking: fix freezing and add missing OCONV", leaving
HunspellImpl::suggest_internal's newly introduced out-parameters 
uninitialized
when the function returns early, causing HunspellImpl::suggest to use 
capwords
uninitialized, as seen when invoking spell-checking in LO built with UBSan:

> hunspell.cxx:907:7: runtime error: load of value 160, which is not a 
valid value for type 'bool'
>  #0 in HunspellImpl::suggest(std::__cxx11::basic_string, std::allocator > const&) at 
workdir/UnpackedTarball/hunspell/src/hunspell/hunspell.cxx:907:7 
(instdir/program/../program/libspelllo.so +0x288ccd)
>  #1 in Hunspell::suggest(std::__cxx11::basic_string, std::allocator > const&) at 
workdir/UnpackedTarball/hunspell/src/hunspell/hunspell.cxx:888:18 
(instdir/program/../program/libspelllo.so +0x288693)
>  #2 in SpellChecker::GetProposals(rtl::OUString const&, 
com::sun::star::lang::Locale const&) at 
lingucomponent/source/spellcheck/spell/sspellimp.cxx:467:56 
(instdir/program/../program/libspelllo.so +0x202913)
>  #3 in SpellChecker::spell(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
lingucomponent/source/spellcheck/spell/sspellimp.cxx:520:17 
(instdir/program/../program/libspelllo.so +0x203b84)
>  #4 in non-virtual thunk to SpellChecker::spell(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
lingucomponent/source/spellcheck/spell/sspellimp.cxx 
(instdir/program/../program/libspelllo.so +0x203e62)
>  #5 in SpellCheckerDispatcher::spell_Impl(rtl::OUString const&, 
o3tl::strong_int, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/spelldsp.cxx:484:44 (instdir/program/liblnglo.so +0x672505)
>  #6 in SpellCheckerDispatcher::spell(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/spelldsp.cxx:227:12 (instdir/program/liblnglo.so +0x670040)
>  #7 in SpellCheckerDispatcher::spell(rtl::OUString const&, short, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/spelldsp.cxx:768:12 (instdir/program/liblnglo.so +0x67b353)
>  #8 in non-virtual thunk to SpellCheckerDispatcher::spell(rtl::OUString 
const&, short, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/spelldsp.cxx (instdir/program/liblnglo.so +0x67b538)
>  #9 in Thesaurus::queryMeanings(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
lingucomponent/source/thesaurus/libnth/nthesimp.cxx:433:27 
(instdir/program/../program/liblnthlo.so +0x88315)
>  #10 in non-virtual thunk to Thesaurus::queryMeanings(rtl::OUString 
const&, com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
lingucomponent/source/thesaurus/libnth/nthesimp.cxx 
(instdir/program/../program/liblnthlo.so +0x8a322)
>  #11 in ThesaurusDispatcher::queryMeanings(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/thesdsp.cxx:181:40 (instdir/program/liblnglo.so +0x6b6fa5)
>  #12 in non-virtual thunk to 
ThesaurusDispatcher::queryMeanings(rtl::OUString const&, 
com::sun::star::lang::Locale const&, 
com::sun::star::uno::Sequence const&) at 
linguistic/source/thesdsp.cxx (instdir/program/liblnglo.so +0x6b7ca2)
>  #13 in 
ThesaurusMenuController::getMeanings(std::__debug::vector >&, rtl::OUString const&, 
com::sun::star::lang::Locale const&, unsigned long) at 
framework/source/uielement/thesaurusmenucontroller.cxx:117:31 
(instdir/program/../program/libfwklo.so +0x1be1a9a)
>  #14 in ThesaurusMenuController::fillPopupMenu() at 
framework/source/uielement/thesaurusmenucontroller.cxx:75:5 
(instdir/program/../program/libfwklo.so +0x1bdf973)
>  #15 in 
ThesaurusMenuController::statusChanged(com::sun::star::frame::FeatureStateEvent 
const&) at framework/source/uielement/thesaurusmenucontroller.cxx:63:9 
(instdir/program/../program/libfwklo.so +0x1bdf24d)
>  #16 in 
SfxDispatchController_Impl::addStatusListener(com::sun::star::uno::Reference
 const&, com::sun::star::util::URL const&) at 
sfx2/source/control/unoctitm.cxx:861:16 (instdir/program/libsfxlo.so +0x2b6851f)
>  #17 in 
SfxOfficeDispatch::addStatusListener(com::sun::star::uno::Reference
 const&, com::sun::star::util::URL const&) at 
sfx2/source/control/unoctitm.cxx:249:16 

[Libreoffice-commits] core.git: external/hunspell

2018-06-25 Thread Christian Lohmaier
 
external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
 |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 79c0327bf8f472faed0dd950d42c060e8766d1c4
Author: Christian Lohmaier 
Date:   Mon Jun 25 13:58:52 2018 +0200

fix hunspell build break for non-cxx11 case

Change-Id: I3da985f87c5e345ca1c11c54a1f6219bf8a54c70
Reviewed-on: https://gerrit.libreoffice.org/56393
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git 
a/external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
 
b/external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
index a4877fb23f61..7c9b255abe74 100644
--- 
a/external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
+++ 
b/external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
@@ -1,3 +1,5 @@
+in addition to that: configure.ac portion was fixed to not have unbalanced []
+
 From d9f392dc35f75b1246862b2db8090e8d5b6ec068 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= 
 Date: Sun, 17 Jun 2018 17:21:01 +0200
@@ -54,7 +56,7 @@ index fb79d0d..2936107 100644
 +AS_CASE([$CXXFLAGS],
 + [*-std=c++11*], [HAVE_CXX11=1],
 + [HAVE_CXX11=0]
-+ ])
++ )
 +AC_SUBST(HAVE_CXX11)
 +
  # Checks for programs.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2018-06-24 Thread László Németh
 external/hunspell/0001-Hunspell-patches-for-missing-OCONV-conversion.patch 
   |  175 +
 
external/hunspell/0001-recent-Hunspell-fixes-for-suggestion-spelling-and-an.patch
 | 1163 ++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |4 
 3 files changed, 1341 insertions(+), 1 deletion(-)

New commits:
commit b691e5824a6346d2fe7f702b5280b56532a2f89e
Author: László Németh 
Date:   Sun Jun 17 13:44:24 2018 +0200

tdf#118162 spell checking: fix freezing and add missing OCONV

conversion, also other smaller fixes of spelling, suggestion
and morphological analysis using recent Hunspell commits.

Several second or more freezing was occured with Hunspell
dictionaries with compound word handling, because of (1)
combinatorical explosion of overlapping word parts, or
(2) unlimited suggestion algorithms (for example MAP) and
(3) multiple suggestion search for a capitalized,
mixed case or abbreviated long word.

Change-Id: I73e196f907e9b73dcd981d275cedb33878a554f6
Reviewed-on: https://gerrit.libreoffice.org/55965
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git 
a/external/hunspell/0001-Hunspell-patches-for-missing-OCONV-conversion.patch 
b/external/hunspell/0001-Hunspell-patches-for-missing-OCONV-conversion.patch
new file mode 100644
index ..83d429f50979
--- /dev/null
+++ b/external/hunspell/0001-Hunspell-patches-for-missing-OCONV-conversion.patch
@@ -0,0 +1,175 @@
+From e13ff056fd65990b88d29fb9eae304b411e58234 Mon Sep 17 00:00:00 2001
+From: Changwoo Ryu 
+Date: Wed, 8 Mar 2017 14:04:26 +0900
+Subject: [PATCH] Hunspell patches for missing OCONV conversion
+
+4e2abfd Clean up PR #479
+cc2d71e Add oconv2 test to Makefile
+ca14fdb Avoid gotos across variable initialization
+7e5cb62 Use goto to reduce repetitive code
+f528192 Add missing OCONV conversion of root and morphemes output
+---
+ src/hunspell/hunspell.cxx | 59 +++
+ tests/test.sh | 23 +++---
+ 2 files changed, 70 insertions(+), 12 deletions(-)
+
+diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
+index 1100a6f..87d1b4a 100644
+--- a/src/hunspell/hunspell.cxx
 b/src/hunspell/hunspell.cxx
+@@ -98,10 +98,13 @@ public:
+   std::vector stem(const std::string& word);
+   std::vector stem(const std::vector& morph);
+   std::vector analyze(const std::string& word);
++  std::vector analyze_internal(const std::string& word);
+   int get_langnum() const;
+   bool input_conv(const std::string& word, std::string& dest);
+   bool spell(const std::string& word, int* info = NULL, std::string* root = 
NULL);
++  bool spell_internal(const std::string& word, int* info = NULL, std::string* 
root = NULL);
+   std::vector suggest(const std::string& word);
++  std::vector suggest_internal(const std::string& word);
+   const std::string& get_wordchars() const;
+   const std::vector& get_wordchars_utf16() const;
+   const std::string& get_dict_encoding() const;
+@@ -415,6 +418,21 @@ bool Hunspell::spell(const std::string& word, int* info, 
std::string* root) {
+ }
+ 
+ bool HunspellImpl::spell(const std::string& word, int* info, std::string* 
root) {
++  bool r = spell_internal(word, info, root);
++  if (r && root) {
++// output conversion
++RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL;
++if (rl) {
++  std::string wspace;
++  if (rl->conv(*root, wspace)) {
++*root = wspace;
++  }
++}
++  }
++  return r;
++}
++
++bool HunspellImpl::spell_internal(const std::string& word, int* info, 
std::string* root) {
+   struct hentry* rv = NULL;
+ 
+   int info2 = 0;
+@@ -834,6 +852,22 @@ std::vector Hunspell::suggest(const 
std::string& word) {
+ 
+ std::vector HunspellImpl::suggest(const std::string& word) {
+   std::vector slst;
++  slst = suggest_internal(word);
++  // output conversion
++  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL;
++  if (rl) {
++for (size_t i = 0; rl && i < slst.size(); ++i) {
++  std::string wspace;
++  if (rl->conv(slst[i], wspace)) {
++slst[i] = wspace;
++  }
++}
++  }
++  return slst;
++}
++
++std::vector HunspellImpl::suggest_internal(const std::string& 
word) {
++  std::vector slst;
+ 
+   int onlycmpdsug = 0;
+   if (!pSMgr || m_HMgrs.empty())
+@@ -1150,15 +1184,6 @@ std::vector HunspellImpl::suggest(const 
std::string& word) {
+   }
+   slst.resize(l);
+ 
+-  // output conversion
+-  rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL;
+-  for (size_t j = 0; rl && j < slst.size(); ++j) {
+-std::string wspace;
+-if (rl->conv(slst[j], wspace)) {
+-  slst[j] = wspace;
+-}
+-  }
+-
+   return slst;
+ }
+ 
+@@ -1365,6 +1390,22 @@ std::vector Hunspell::analyze(const 
std::string& word) {
+ 
+ std::vector HunspellImpl::analyze(const std::string& word) {
+   std::vector slst;
++  slst = analyze_internal(word);
++  // output conversion
++  RepList* rl = 

[Libreoffice-commits] core.git: external/hunspell

2018-04-03 Thread László Németh
 
external/hunspell/0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
 |   62 ++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |1 
 2 files changed, 63 insertions(+)

New commits:
commit 18ce9d80dc1ba0262e145a015526da7c0851a74b
Author: László Németh 
Date:   Mon Mar 26 00:43:11 2018 +0200

tdf#116586 fix LibreOffice crash by Hungarian personal dictionary

"AkH. 11. (old orthography)", caused by bad handling of forbidden words
of alias compressed dictionaries during run-time dictionary extension.

Note: accepting also all – previously forbidden – affixed
forms of the modified stem is a removed function: "Grammar by" spell
checking (for example, in LibreOffice via SPELLML interface of Hunspell)
supports user words with affixation and compounding.

The original idea was to add substandard or interfering words
as forbidden words – but with flags – to the dictionary, and adding
the stem to the personal dictionary could “switch on” the affixed
forms of the word, too. Now the suggested method is using
"Grammar by" personal dictionaries, as in LibreOffice:


https://wiki.documentfoundation.org/ReleaseNotes/6.0#.E2.80.9CGrammar_By.E2.80.9D_spell_checking

Change-Id: I8160d3f49a73cb2481d51c336115b6c27e7c9f1d
Reviewed-on: https://gerrit.libreoffice.org/51844
Tested-by: Jenkins 
Reviewed-by: László Németh 

diff --git 
a/external/hunspell/0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
 
b/external/hunspell/0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
new file mode 100644
index ..e26ee735423b
--- /dev/null
+++ 
b/external/hunspell/0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
@@ -0,0 +1,62 @@
+From 987fd8c3ed648ca7d637f2dbb86e97c600954d2c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= 
+Date: Sun, 25 Mar 2018 23:51:47 +0200
+Subject: [PATCH] tdf#116586 fix LibreOffice crash by Hungarian personal
+ dictionary
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+"AkH. 11. (old orthography)", caused by bad handling of forbidden words
+of alias compressed dictionaries during run-time dictionary extension.
+
+Note: accepting also all – previously forbidden – affixed
+forms of the modified stem is a removed function: "Grammar by" spell
+checking (for example, in LibreOffice via SPELLML interface of Hunspell)
+supports user words with affixation and compounding.
+
+The original idea was to add substandard or interfering words
+as forbidden words – but with flags – to the dictionary, and adding
+the stem to the personal dictionary could “switch on” the affixed
+forms of the word, too. Now the suggested method is using
+"Grammar by" personal dictionaries, as in LibreOffice:
+
+https://wiki.documentfoundation.org/ReleaseNotes/6.0#.E2.80.9CGrammar_By.E2.80.9D_spell_checking
+---
+ src/hunspell/hashmgr.cxx | 20 ++--
+ 1 file changed, 2 insertions(+), 18 deletions(-)
+
+diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx
+index ec3803b..5183f02 100644
+--- a/src/hunspell/hashmgr.cxx
 b/src/hunspell/hashmgr.cxx
+@@ -506,24 +506,8 @@ int HashMgr::remove_forbidden_flag(const std::string& 
word) {
+   if (!dp)
+ return 1;
+   while (dp) {
+-if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
+-  if (dp->alen == 1)
+-dp->alen = 0;  // XXX forbidden words of personal dic.
+-  else {
+-unsigned short* flags2 =
+-(unsigned short*)malloc(sizeof(unsigned short) * (dp->alen - 1));
+-if (!flags2)
+-  return 1;
+-int i, j = 0;
+-for (i = 0; i < dp->alen; i++) {
+-  if (dp->astr[i] != forbiddenword)
+-flags2[j++] = dp->astr[i];
+-}
+-dp->alen--;
+-free(dp->astr);
+-dp->astr = flags2;  // XXX allowed forbidden words
+-  }
+-}
++if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen))
++  dp->alen = 0;  // XXX forbidden words of personal dic.
+ dp = dp->next_homonym;
+   }
+   return 0;
+-- 
+2.7.4
+
diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 8c7e08a36afc..c76233c546d7 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \
external/hunspell/0001-fix-compound-word-part-pa.patch \

external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
 \
external/hunspell/0001-Recent-Hunspell-fixes-and-improvements.patch \
+
external/hunspell/0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
 \
 ))
 
 # vim: set noet sw=4 ts=4:

[Libreoffice-commits] core.git: external/hunspell

2017-12-14 Thread László Németh
 external/hunspell/0001-Recent-Hunspell-fixes-and-improvements.patch | 1605 
++
 external/hunspell/UnpackedTarball_hunspell.mk   |1 
 2 files changed, 1606 insertions(+)

New commits:
commit 721e6eb9899aa4ff6ee943e81caddb1722139adf
Author: László Németh 
Date:   Wed Dec 13 20:51:10 2017 +0100

Add recent Hunspell fixes and improvements

from Hunspell repository to give
better spell checking and suggestions.

Short Hunspell commit descriptions (complete commit
descriptions are in the committed Hunspell patch):

4a8921b BREAK tries to break at the second word break
957950b Spelling dictionary should be a real spelling dictionary
0b8a4d8 Use only middle replentries for compound word checking
4e4106f Reduce strange ngram suggestions
89a8ec6 Optimize condition order in walk_hashtable loop
e80685c Remove SUBSTANDARD dictionary roots from suggestions.
90cb55f Clean-up ngram suggestions for lowercase words
bbf2eb4 word pairs of the dic file get highest suggestion priority
0667049 check dictionary word pairs to filter compound word overgeneration
ebdd308 clean-up suggestion
526f600 skip empty ph: field and support character stripping
eb97eb7 Dictionary words with COMPOUNDFORBIDFLAG are removed
8912f2a Allow suggestion search for prefix + *two suffixes*
caa24d6 Improve ph: usage for capitalization and Unicode
05082b4 BREAK: keep also break-at-first-break-point breaking
db142a3 Fix regression in Hungarian "moving rule"
711466a fix compiler warnings
7ba5beb Support dictionary based REP replacements

Change-Id: I7f7202acf2dccec05ef9c542362b432aa8566a86
Reviewed-on: https://gerrit.libreoffice.org/45918
Tested-by: Jenkins 
Reviewed-by: László Németh 

diff --git 
a/external/hunspell/0001-Recent-Hunspell-fixes-and-improvements.patch 
b/external/hunspell/0001-Recent-Hunspell-fixes-and-improvements.patch
new file mode 100644
index ..eb48c283b38c
--- /dev/null
+++ b/external/hunspell/0001-Recent-Hunspell-fixes-and-improvements.patch
@@ -0,0 +1,1605 @@
+From 9ad1696fb13d65e5d569b7106749dd4014877c15 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= 
+Date: Wed, 13 Dec 2017 19:27:30 +0100
+Subject: [PATCH] Recent Hunspell fixes and improvements
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Containing the following up-stream patches:
+
+commit 7ba5beb517310a942bafd7d6d08fc92beae0e439
+Author: László Németh 
+Date:   Wed Dec 13 19:01:35 2017 +0100
+
+Support dictionary based REP replacements
+
+using the following syntax in the dic file:
+
+word ph:pattern->replacement
+
+commit 711466a276d5d9f3a5f6e9089bb3262894196fbc
+Author: László Németh 
+Date:   Tue Dec 12 15:09:36 2017 +0100
+
+fix compiler warnings
+
+commit db142a3addc87bbbdd9a76bc519c69e8ad95af73
+Author: László Németh 
+Date:   Fri Dec 1 17:24:17 2017 +0100
+
+Fix regression in Hungarian "moving rule"
+
+from commit eb97eb789cec47a172f6e9a01db3e6cf3b8dc81d.
+
+Dictionary words with COMPOUNDFORBIDFLAG are removed
+from the beginning and middle of compound words,
+overriding the effect of COMPOUNDPERMITFLAG,
+except in Hungarian "moving rule".
+
+Add test example.
+
+commit 05082b4e8a917cfbddefbc5fd2d543895b27f4c1
+Author: László Németh 
+Date:   Fri Dec 1 16:11:20 2017 +0100
+
+BREAK: keep also break-at-first-break-point breaking
+
+to handle the case of suffixes with dashes in compounds.
+
+Add also test example.
+
+commit caa24d60f1a4514d4e0ef48fa14105e85eb6514c
+Author: László Németh 
+Date:   Fri Dec 1 11:16:35 2017 +0100
+
+Improve ph: usage for capitalization and Unicode
+
+- at capitalized dictionary words, add lowercase ph: patterns
+  to the REP rules in a capitalized form, too, to get correct
+  suggestions for lowercase and capitalized mispellings:
+
+  Wednesday ph:wendsay (in dic file) results
+
+  both wendsay and Wendsay -> Wednesday suggestions.
+
+  For German and Hungarian:
+
+  add also lowercase pattern -> lowercase dictionary word
+  replacement to the REP rules, supporting lowercasing
+  by compound word generation or derivational suffixes.
+
+- fix UTF-8 support of starred ph: fields
+
+- test examples
+
+commit 8912f2ade54cdc186fe0580471063d92d99eb572
+Author: László Németh 
+Date:   Fri Dec 1 10:26:07 2017 +0100
+
+Allow suggestion search for prefix + *two suffixes*
+
+Remove artificial performance limit to get correct
+suggestions for relatively simple misspellings in
+Hungarian, etc., when the word form contains prefix
+and both 

[Libreoffice-commits] core.git: external/hunspell

2017-11-17 Thread László Németh
 
external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
 |   40 ++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |1 
 2 files changed, 41 insertions(+)

New commits:
commit a7ec994689f8ea5985f6c8f94f17a4417978ff41
Author: László Németh 
Date:   Thu Nov 9 15:49:46 2017 +0100

apply patch for run-time Hunspell dictionary extension

to use in new "Affixation/Compounding By" feature of
language-specific LibreOffice user dictionaries.

Change-Id: Icb4181717f0ff1145ac5acc130266b165132cfe9
Reviewed-on: https://gerrit.libreoffice.org/44561
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git 
a/external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
 
b/external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
new file mode 100644
index ..c17d168b2478
--- /dev/null
+++ 
b/external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
@@ -0,0 +1,40 @@
+From 643bd113f5dbfa6e8ffa61aae6ab7ccc4f63bccc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= 
+Date: Thu, 9 Nov 2017 13:22:55 +0100
+Subject: [PATCH] add SPELLML support for run-time dictionary extension
+
+to use in new "Affixation/Compounding By" feature
+of language-specific LibreOffice user dictionaries.
+---
+ src/hunspell/hunspell.cxx | 15 +++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
+index b271750..09fd6ee 100644
+--- a/src/hunspell/hunspell.cxx
 b/src/hunspell/hunspell.cxx
+@@ -1733,6 +1733,21 @@ std::vector HunspellImpl::spellml(const 
std::string& in_word) {
+ }
+   }
+ }
++  } else if (check_xml_par(q, "type=", "add")) {
++std::string cw = get_xml_par(strchr(q2, '>'));
++if (cw.empty())
++  return slst;
++const char* q3 = strstr(q2 + 1, "'));
++  if (!cw2.empty()) {
++add_with_affix(cw, cw2);
++  } else {
++add(cw);
++  }
++} else {
++add(cw);
++}
+   }
+   return slst;
+ }
+-- 
+2.7.4
+
diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 23d3aca47131..87f12446427c 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell, \

external/hunspell/0001-Remove-forbidden-words-from-dash-suggestion-list.patch \

external/hunspell/0001-fix-compound-handling-for-new-Hungarian-orthography.patch
 \
external/hunspell/0001-fix-compound-word-part-pa.patch \
+   
external/hunspell/0001-add-SPELLML-support-for-run-time-dictionary-extensio.patch
 \
 ))
 
 # vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2017-11-06 Thread László Németh
 
external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
 |   55 
 
external/hunspell/0001-Extend-dotless-i-and-dotted-I-rules-to-Crimean-Tatar.patch
 |   66 ++
 external/hunspell/0001-FORBIDDENWORD-precedes-BREAK.patch  
   |   27 
 external/hunspell/0001-Remove-forbidden-words-from-dash-suggestion-list.patch  
   |   29 
 
external/hunspell/0001-fix-compound-handling-for-new-Hungarian-orthography.patch
  |   43 ++
 external/hunspell/0001-fix-compound-word-part-pa.patch 
   |   26 +++
 external/hunspell/UnpackedTarball_hunspell.mk  
   |6 
 7 files changed, 252 insertions(+)

New commits:
commit f037207675010fdff2c1968a67fae5b0c2c34331
Author: László Németh 
Date:   Thu Nov 2 09:51:36 2017 +0100

fix spell checking issues using recent Hunspell patches

Test: English word "Ian" are "item" are not allowed as "Ä°an", "Ä°tem" now.

Patch list with commit ids in Hunspell repository:

commit 66badb7449c2053c89456f11a7f71f3f5916b550
Extend dotless i and dotted I rules to Crimean Tatar language

commit 88cf975c295e3ec808efb77bb1a2a031d77f0c89
Allow dotted I in dictionary, and disable bad capitalization

commit 39b785a6b03b35cc8a27f43f6005dcaa432694e1
FORBIDDENWORD precedes BREAK

commit 0f691abe68788d0a58e72ab66877a9f670cd2741
Remove forbidden words from dash suggestion list

commit 15b2cde4f01706f0a648518a5cfc57394d015448
tdf#95024 fix compound handling for new Hungarian orthography

commit de3ae6844af62300e473f7b7b66a56e54153b4b9
fix compound word part "pa:"

Change-Id: Id12b5629b0c975464072b5b144743cbe40fe45a3
Reviewed-on: https://gerrit.libreoffice.org/44200
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git 
a/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
 
b/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
new file mode 100644
index ..b4b04385c935
--- /dev/null
+++ 
b/external/hunspell/0001-Allow-dotted-I-in-dictionary-and-disable-bad-capital.patch
@@ -0,0 +1,55 @@
+From 88cf975c295e3ec808efb77bb1a2a031d77f0c89 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ 
+Date: Thu, 5 Oct 2017 12:24:02 +0200
+Subject: [PATCH] Allow dotted I in dictionary, and disable bad capitalization
+ of i.
+
+Dictionary words weren't recognized with dotted I, but dictionary
+words with the letter i were recognized with dotted I, too.
+---
+ src/hunspell/hunspell.cxx | 18 +-
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
+index 1ef11df..5c98f8a 100644
+--- a/src/hunspell/hunspell.cxx
 b/src/hunspell/hunspell.cxx
+@@ -562,11 +562,15 @@ bool HunspellImpl::spell(const std::string& word, int* 
info, std::string* root)
+   }
+ }
+ case INITCAP: {
+-
++  // handle special capitalization of dotted I
++  bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) 
scw[1] == 0xb0);
+   *info += SPELL_ORIGCAP;
+-  mkallsmall2(scw, sunicw);
+-  std::string u8buffer(scw);
+-  mkinitcap2(scw, sunicw);
++  if (captype == ALLCAP) {
++  mkallsmall2(scw, sunicw);
++  mkinitcap2(scw, sunicw);
++  if (Idot)
++ scw.replace(0, 1, "\xc4\xb0");
++  }
+   if (captype == INITCAP)
+ *info += SPELL_INITCAP;
+   rv = checkword(scw, info, root);
+@@ -581,9 +585,13 @@ bool HunspellImpl::spell(const std::string& word, int* 
info, std::string* root)
+   }
+   if (rv && is_keepcase(rv) && (captype == ALLCAP))
+ rv = NULL;
+-  if (rv)
++  if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum 
!= LANG_crh))
+ break;
+ 
++  mkallsmall2(scw, sunicw);
++  std::string u8buffer(scw);
++  mkinitcap2(scw, sunicw);
++
+   rv = checkword(u8buffer, info, root);
+   if (abbv && !rv) {
+ u8buffer.push_back('.');
+-- 
+1.9.1
+
diff --git 
a/external/hunspell/0001-Extend-dotless-i-and-dotted-I-rules-to-Crimean-Tatar.patch
 
b/external/hunspell/0001-Extend-dotless-i-and-dotted-I-rules-to-Crimean-Tatar.patch
new file mode 100644
index ..66cc78188521
--- /dev/null
+++ 
b/external/hunspell/0001-Extend-dotless-i-and-dotted-I-rules-to-Crimean-Tatar.patch
@@ -0,0 +1,66 @@
+From 66badb7449c2053c89456f11a7f71f3f5916b550 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ 
+Date: Thu, 5 Oct 2017 11:13:28 +0200
+Subject: [PATCH] Extend dotless i and dotted I rules to Crimean Tatar language
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+to 

[Libreoffice-commits] core.git: external/hunspell

2017-06-12 Thread jan Iversen
 external/hunspell/0001-Revert-Remove-autotools-autogenerated-files.patch |
4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 659d6b468b41692ebf0645596e39744f2e90621e
Author: jan Iversen 
Date:   Mon Jun 12 17:00:36 2017 +0200

iOS, update hunspell "revert commit" patch

Added support for arm64, by modifying the
patch that reverts an earlier commit.

Change-Id: If0d1920c1a91b3ad44c4ae9c299270b7806db811

diff --git 
a/external/hunspell/0001-Revert-Remove-autotools-autogenerated-files.patch 
b/external/hunspell/0001-Revert-Remove-autotools-autogenerated-files.patch
index ab6b19d2442a..b40b71e2ea7c 100644
--- a/external/hunspell/0001-Revert-Remove-autotools-autogenerated-files.patch
+++ b/external/hunspell/0001-Revert-Remove-autotools-autogenerated-files.patch
@@ -4937,7 +4937,7 @@ index 000..6467c95
 +  | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | 
alpha64pca5[67] \
 +  | am33_2.0 \
 +  | arc | arceb \
-+  | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
++  | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] | 
arm64 \
 +  | avr | avr32 \
 +  | be32 | be64 \
 +  | bfin \
@@ -5058,7 +5058,7 @@ index 000..6467c95
 +  | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 +  | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
 +  | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-+  | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
++  | arm-*  | armbe-* | armle-* | armeb-* | armv*-* | arm64-* \
 +  | avr-* | avr32-* \
 +  | be32-* | be64-* \
 +  | bfin-* | bs2000-* \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2017-03-24 Thread László Németh
 external/hunspell/0002-fix-other-regression-in-compounding.patch | 
  43 ++
 external/hunspell/0005-fix-syllable-counting-in-compound-word-handling.patch | 
  66 ++
 external/hunspell/UnpackedTarball_hunspell.mk| 
   2 
 3 files changed, 111 insertions(+)

New commits:
commit 3bc686ca3e746560770bfe24cd0b515cfdf83bd1
Author: László Németh 
Date:   Fri Mar 24 15:26:49 2017 +0100

tdf#106751 fix regressions in Hungarian spell checking

using recent fixes of Hunspell code base

Change-Id: I180a2ecba924180419c5eb1a0e78b5c84e7242c4
Reviewed-on: https://gerrit.libreoffice.org/35665
Tested-by: Jenkins 
Reviewed-by: László Németh 
Tested-by: László Németh 

diff --git a/external/hunspell/0002-fix-other-regression-in-compounding.patch 
b/external/hunspell/0002-fix-other-regression-in-compounding.patch
new file mode 100644
index ..cbf29e54f93a
--- /dev/null
+++ b/external/hunspell/0002-fix-other-regression-in-compounding.patch
@@ -0,0 +1,43 @@
+From 1fada01663b29b57c010a9c274e45a5cf9ecf222 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ 
+Date: Sun, 19 Mar 2017 13:19:29 +0100
+Subject: [PATCH 2/7] fix other regression in compounding
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Allow compound words again with
+starting "kor", "alak", "asszony", "úr"
+related to the "REP kor _kor" etc. rules
+using the Hungarian spelling dictionary.
+
+regression from...
+
+commit 73b1cad1af7ab94252f75784fa6724cf062a6966
+Author: Martin Hosken 
+Date:   Mon Apr 18 16:28:26 2016 +0700
+
+Add support for bounded conversion
+---
+ src/hunspell/affixmgr.cxx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 78c70e7..ec2093d 100644
+--- a/src/hunspell/affixmgr.cxx
 b/src/hunspell/affixmgr.cxx
+@@ -1290,8 +1290,8 @@ int AffixMgr::cpdrep_check(const char* word, int wl) {
+ // search every occurence of the pattern in the word
+ while ((r = strstr(r, reptable[i].pattern.c_str())) != NULL) {
+   std::string candidate(word);
+-  size_t type = r == word ? 1 : 0;
+-  if (r - word + reptable[i].pattern.size() == lenp)
++  size_t type = r == word && langnum != LANG_hu ? 1 : 0;
++  if (r - word + reptable[i].pattern.size() == lenp && langnum != LANG_hu)
+ type += 2;
+   candidate.replace(r - word, lenp, reptable[i].outstrings[type]);
+   if (candidate_check(candidate.c_str(), candidate.size()))
+-- 
+2.7.4
+
diff --git 
a/external/hunspell/0005-fix-syllable-counting-in-compound-word-handling.patch 
b/external/hunspell/0005-fix-syllable-counting-in-compound-word-handling.patch
new file mode 100644
index ..670d938e5441
--- /dev/null
+++ 
b/external/hunspell/0005-fix-syllable-counting-in-compound-word-handling.patch
@@ -0,0 +1,66 @@
+From f4ec6a283f972c82d068f4472320d424c40d45cb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ 
+Date: Thu, 23 Mar 2017 16:40:52 +0100
+Subject: [PATCH 5/7] fix syllable counting in compound word handling
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Note: one of the fixed regressions is related to an old
+hidden mistake: using clen instead of blen of the stem
+word lengths was indifferent with the original get_syllable(),
+because blen == clen at 8-bit encodings, and UTF-8
+words were handled by null-termination. Implementing Unicode
+support in Hunspell, clen was changed only in
+compound_check_morph() to blen accidentally, but not
+in compound_check(), resulting problems from the
+recent std::string conversion.
+
+Now this commit is a real fix for the regression from the
+commit c63c93237e4decdba5544a96093448605ac549c2,
+instead of the following bad fix:
+
+commit d06b0c57ae87ee8743f1bf53f80c1f8e364db619
+Author: László Németh 
+Date:   Fri Mar 17 15:11:23 2017 +0100
+
+fix Hungarian compound word handling
+---
+ src/hunspell/affixmgr.cxx | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 2ed8233..3d65539 100644
+--- a/src/hunspell/affixmgr.cxx
 b/src/hunspell/affixmgr.cxx
+@@ -1816,7 +1816,7 @@ struct hentry* AffixMgr::compound_check(const 
std::string& word,
+   // LANG_hu section: spec. Hungarian rule
+   if (langnum == LANG_hu) {
+ // calculate syllable number of the word
+-numsyllable += get_syllable(st.substr(i));
++numsyllable += get_syllable(st.substr(0, i));
+ // + 1 word, if syllable number of the prefix > 1 (hungarian
+ // 

[Libreoffice-commits] core.git: external/hunspell

2017-02-12 Thread Caolán McNamara
 external/hunspell/0001-cppcheck-redundant-c_str.patch  
   |   34 
 external/hunspell/0001-cppcheck-rv-is-reassigned-before-old-value-used.patch   
   |   57 
 external/hunspell/0001-loop-via-iterators.patch
   |   36 
 
external/hunspell/0002-add-a-get_clen_and_captype-varient-that-takes-a-buff.patch
 |   78 
 external/hunspell/0002-rename-std-vector-w_char-to-wide-string.patch   
   |  912 --
 
external/hunspell/0003-Related-hunspell-406-use-a-basic_string-w_char-inste.patch
 |   37 
 external/hunspell/0003-hoist-string-lowering-from-ngram-to-ngsuggest.patch 
   |  264 ++
 
external/hunspell/0004-either-clear-will-be-called-anyway-before-use-or-its.patch
 |   81 
 
external/hunspell/0004-use-a-per-hashmgr-persistent-wide-string-scratch-buf.patch
 |  117 -
 
external/hunspell/0005-use-a-per-hashmgr-persistent-wide-string-scratch-buf.patch
 |  168 -
 external/hunspell/UnpackedTarball_hunspell.mk  
   |   10 
 11 files changed, 556 insertions(+), 1238 deletions(-)

New commits:
commit 163435fa23fbfc237a7718c9d440a98847e4f626
Author: Caolán McNamara 
Date:   Sun Feb 12 17:20:56 2017 +

use alternative optimizations for buffer creation bottleneck

Change-Id: I9f29e8d3e5e97fe403a3e0d7d03c6ac01c7689c4

diff --git a/external/hunspell/0001-cppcheck-redundant-c_str.patch 
b/external/hunspell/0001-cppcheck-redundant-c_str.patch
new file mode 100644
index 000..276ddd2
--- /dev/null
+++ b/external/hunspell/0001-cppcheck-redundant-c_str.patch
@@ -0,0 +1,34 @@
+From 9a0baf202f67291eaf482f1bcf654e21d71943e2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Mon, 23 Jan 2017 11:43:53 +
+Subject: [PATCH] cppcheck: redundant c_str
+
+---
+ src/hunspell/suggestmgr.cxx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
+index b998341..8d46dd6 100644
+--- a/src/hunspell/suggestmgr.cxx
 b/src/hunspell/suggestmgr.cxx
+@@ -1107,7 +1107,7 @@ void SuggestMgr::ngsuggest(std::vector& 
wlst,
+ int sc2;
+ if (utf8) {
+   w_f.clear();
+-  u8_u16(w_f, f.c_str());
++  u8_u16(w_f, f);
+   sc2 = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE + low) +
+ leftcommonsubstring(w_word, w_f);
+ } else {
+@@ -1132,7 +1132,7 @@ void SuggestMgr::ngsuggest(std::vector& 
wlst,
+ std::string target2 = phonet(candidate, *ph);
+ w_target2.clear();
+ if (utf8) {
+-  u8_u16(w_target2, target2.c_str());
++  u8_u16(w_target2, target2);
+   scphon = 2 * ngram(3, w_target, w_target2,
+  NGRAM_LONGER_WORSE);
+ } else {
+-- 
+2.9.3
+
diff --git 
a/external/hunspell/0001-cppcheck-rv-is-reassigned-before-old-value-used.patch 
b/external/hunspell/0001-cppcheck-rv-is-reassigned-before-old-value-used.patch
new file mode 100644
index 000..bfcdf49
--- /dev/null
+++ 
b/external/hunspell/0001-cppcheck-rv-is-reassigned-before-old-value-used.patch
@@ -0,0 +1,57 @@
+From 93156ba9a8e644f8b0b724880668714adcb0d094 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Mon, 23 Jan 2017 12:05:07 +
+Subject: [PATCH] cppcheck: rv is reassigned before old value used
+
+---
+ src/hunspell/affixmgr.cxx   | 6 ++
+ src/hunspell/suggestmgr.cxx | 3 +--
+ 2 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 680cbe9..21cf384 100644
+--- a/src/hunspell/affixmgr.cxx
 b/src/hunspell/affixmgr.cxx
+@@ -1494,9 +1494,8 @@ int AffixMgr::defcpd_check(hentry*** words,
+ }
+ 
+ inline int AffixMgr::candidate_check(const char* word, int len) {
+-  struct hentry* rv = NULL;
+ 
+-  rv = lookup(word);
++  struct hentry* rv = lookup(word);
+   if (rv)
+ return 1;
+ 
+@@ -3045,10 +3044,9 @@ struct hentry* AffixMgr::affix_check(const char* word,
+  int len,
+  const FLAG needflag,
+  char in_compound) {
+-  struct hentry* rv = NULL;
+ 
+   // check all prefixes (also crossed with suffixes if allowed)
+-  rv = prefix_check(word, len, in_compound, needflag);
++  struct hentry* rv = prefix_check(word, len, in_compound, needflag);
+   if (rv)
+ return rv;
+ 
+diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
+index 8d46dd6..54a474f 100644
+--- a/src/hunspell/suggestmgr.cxx
 b/src/hunspell/suggestmgr.cxx
+@@ -1675,11 +1675,10 @@ std::string SuggestMgr::suggest_hentry_gen(hentry* rv, 
const char* pattern) {
+   if (HENTRY_DATA(rv))
+ p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
+   while (p) {
+-struct hentry* rv2 = NULL;
+ p += MORPH_TAG_LEN;
+ int plen = fieldlen(p);
+ std::string 

[Libreoffice-commits] core.git: external/hunspell

2017-02-12 Thread Caolán McNamara
 external/hunspell/ExternalProject_hunspell.mk |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 804287e4ab0ae0e9f5d61446b473c9cd985e9674
Author: Caolán McNamara 
Date:   Sun Feb 12 17:37:40 2017 +

Resolves: tdf#105426 helpful to actually let the compiler optimize hunspell

*facepalm*

Change-Id: I5f6d6cb94e1a80d2d7ae96900517aae3c8f39f08
Reviewed-on: https://gerrit.libreoffice.org/34176
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index 4c3b74d..984485f 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -13,18 +13,14 @@ $(eval $(call gb_ExternalProject_register_targets,hunspell,\
build \
 ))
 
-hunspell_CXXFLAGS=$(CXXFLAGS)
+hunspell_CPPCLAGS=$(CPPFLAGS)
 
 ifneq (,$(filter ANDROID DRAGONFLY FREEBSD IOS LINUX NETBSD OPENBSD,$(OS)))
 ifneq (,$(gb_ENABLE_DBGUTIL))
-hunspell_CXXFLAGS+=-D_GLIBCXX_DEBUG
+hunspell_CPPFLAGS+=-D_GLIBCXX_DEBUG
 endif
 endif
 
-ifneq (,$(debug))
-hunspell_CXXFLAGS+=-g
-endif
-
 $(call gb_ExternalProject_get_state_target,hunspell,build):
$(call gb_ExternalProject_run,build,\
$(if $(filter IOS MACOSX,$(OS)),ACLOCAL="aclocal -I 
$(SRCDIR)/m4/mac") \
@@ -33,7 +29,8 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
$(SHELL) ./configure --disable-shared --disable-nls --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM))\
$(if $(filter 
AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
-   CXXFLAGS="$(hunspell_CXXFLAGS)" \
+   $(if 
$(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
+   CXXFLAGS="$(CXXFLAGS) $(if 
$(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUGINFO_FLAGS) 
$(gb_DEBUG_CXXFLAGS),$(gb_COMPILEROPTFLAGS))" \
&& cd src/hunspell && $(MAKE) \
)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2017-01-24 Thread Caolán McNamara
 external/hunspell/ExternalProject_hunspell.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a3fe4ca1b1ac5262268da456f7260f8de6de0ba1
Author: Caolán McNamara 
Date:   Tue Jan 24 11:20:45 2017 +

just build the hunspell lib, not the rest

might hack around link failures of the hunspell tools under arm

Change-Id: Ib5db702c2898e909e2bb91f4c4bc6b91bd08f47b

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index a4935db..274778a 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -35,7 +35,7 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
$(if $(filter 
AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
$(if $(filter-out 
WNTGCC,$(OS)$(COM)),,LDFLAGS="-Wl,--enable-runtime-pseudo-reloc-v2") \
CXXFLAGS="$(hunspell_CXXFLAGS)" \
-   && $(MAKE) \
+   && cd src/hunspell && $(MAKE) \
)
 
 # vim: set noet sw=4 ts=4:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2016-12-21 Thread Stephan Bergmann
 external/hunspell/UnpackedTarball_hunspell.mk |6 ++
 external/hunspell/clangcl-werror.patch|   11 +++
 2 files changed, 17 insertions(+)

New commits:
commit 4e7f8e5a82e57914d07be2508c9e3ca3f7ca6ff0
Author: Stephan Bergmann 
Date:   Wed Dec 21 18:13:48 2016 +0100

external/hunspell: Work around -Werror,-Wundef with clang-cl

...when lingucomponent/source/spellcheck/spell/sspellimp.cxx includes
hunspell.hxx

Change-Id: Ibb4b2901a9dfbf7e145281bedeaa9d8daf79aba5

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 127ca5d..f2bda3f5 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -17,4 +17,10 @@ $(eval $(call gb_UnpackedTarball_set_post_action,hunspell,\
 ))
 endif
 
+$(eval $(call gb_UnpackedTarball_set_patchlevel,hunspell,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hunspell, \
+external/hunspell/clangcl-werror.patch \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/clangcl-werror.patch 
b/external/hunspell/clangcl-werror.patch
new file mode 100755
index 000..1a41da9
--- /dev/null
+++ b/external/hunspell/clangcl-werror.patch
@@ -0,0 +1,11 @@
+--- src/hunspell/hunspell.hxx
 src/hunspell/hunspell.hxx
+@@ -85,7 +85,7 @@
+ #define MAXSHARPS 5
+ #define MAXWORDLEN 176
+ 
+-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
++#if defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 
1))
+ #  define H_DEPRECATED __attribute__((__deprecated__))
+ #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
+ #  define H_DEPRECATED __declspec(deprecated)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2016-04-15 Thread Michael Stahl
 external/hunspell/UnpackedTarball_hunspell.mk |1 +
 external/hunspell/hunspell-iterator.patch.1   |   22 ++
 2 files changed, 23 insertions(+)

New commits:
commit e63f6503fc160ed8c1b8867ac8300fa9f3e9723e
Author: Michael Stahl 
Date:   Fri Apr 15 23:38:56 2016 +0200

hunspell: MSVC debug runtime iterators don't want to decrement past begin()

Change-Id: I258dc551d14ba72113b284be3566ba924434ab4c

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 943e788..3aae579 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -13,6 +13,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-solaris.patch \
+   external/hunspell/hunspell-iterator.patch.1 \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-iterator.patch.1 
b/external/hunspell/hunspell-iterator.patch.1
new file mode 100644
index 000..046d6e0
--- /dev/null
+++ b/external/hunspell/hunspell-iterator.patch.1
@@ -0,0 +1,22 @@
+MSVC debug runtime iterators don't want to be decremented past begin()
+
+--- hunspell/src/hunspell/affixmgr.cxx.orig2016-04-15 23:30:37.555875079 
+0200
 hunspell/src/hunspell/affixmgr.cxx 2016-04-15 23:30:43.669875027 +0200
+@@ -4638,7 +4638,7 @@
+   return;
+ 
+   int neg = 0;
+-  for (std::string::iterator k = piece.begin() + piece.size() - 1; k >= 
piece.begin(); --k) {
++  for (std::string::iterator k = piece.begin() + piece.size() - 1; ; --k) {
+ switch (*k) {
+   case '[': {
+ if (neg)
+@@ -4666,6 +4666,8 @@
+   *(k + 1) = *k;
+   }
+ }
++if (k == piece.begin())
++break;
+   }
+ }
+ 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2016-04-07 Thread Stephan Bergmann
 external/hunspell/UnpackedTarball_hunspell.mk |1 +
 external/hunspell/ubsan.patch.0   |   11 +++
 2 files changed, 12 insertions(+)

New commits:
commit 16048590bb486ffa3b0a257c31390dc500f7360a
Author: Stephan Bergmann 
Date:   Thu Apr 7 11:08:55 2016 +0200

external/hunspell: -fsanitize=shift

Change-Id: Ifc78a8f1a0a6fa29ef9becc5432e581f42241467

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index e70e33f..7ce4aea 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -14,6 +14,7 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
 $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-solaris.patch \
external/hunspell/hunspell-windows.patch \
+   external/hunspell/ubsan.patch.0 \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/ubsan.patch.0 b/external/hunspell/ubsan.patch.0
new file mode 100644
index 000..af25d6a
--- /dev/null
+++ b/external/hunspell/ubsan.patch.0
@@ -0,0 +1,11 @@
+--- src/hunspell/csutil.cxx
 src/hunspell/csutil.cxx
+@@ -281,7 +281,7 @@
+   u2->h = ((*u8 & 0x0f) << 4) + ((*(u8 + 1) & 0x3f) >> 2);
+   u8++;
+   if ((*(u8 + 1) & 0xc0) == 0x80) {
+-u2->l = (*u8 << 6) + (*(u8 + 1) & 0x3f);
++u2->l = (static_cast(*u8) << 6) + (*(u8 + 1) & 
0x3f);
+ u8++;
+   } else {
+ HUNSPELL_WARNING(stderr,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2015-10-13 Thread László Németh
 external/hunspell/UnpackedTarball_hunspell.mk  |1 
 external/hunspell/hunspell-tdf95024-compound.patch |  108 +
 2 files changed, 109 insertions(+)

New commits:
commit 2511a21841dd9dec735a53add8174e47d24deb88
Author: László Németh 
Date:   Wed Oct 14 01:17:26 2015 +0200

tdf#95024 fix compound word handling for new Hungarian orthography

This commit contains the recent Hunspell fix for Hungarian compound
word handling (commit 42807f970ac2d65f0d13a7c57eb454b210e92240
in Hunspell git repository), changing spell checking only
in Hungarian documents.

Change-Id: I1c6c3736ecf8c1e2fffcf1c53959b25dc9d27966

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 6ad31dd..8f14062 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-morph-overflow.patch \
external/hunspell/ubsan.patch.0 \
external/hunspell/hunspell-1.3.3-rhbz1261421.patch \
+   external/hunspell/hunspell-tdf95024-compound.patch \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-tdf95024-compound.patch 
b/external/hunspell/hunspell-tdf95024-compound.patch
new file mode 100644
index 000..133cf4a
--- /dev/null
+++ b/external/hunspell/hunspell-tdf95024-compound.patch
@@ -0,0 +1,108 @@
+From 42807f970ac2d65f0d13a7c57eb454b210e92240 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
+ 
+Date: Mon, 12 Oct 2015 08:43:12 +0200
+Subject: [PATCH] fix compound handling for new Hungarian orthography
+
+The frequent cases of this compound limitation are handled by
+the extended dictionary, but not these ones with both derivative
+and inflectional suffixes.
+---
+ src/hunspell/affixmgr.cxx | 19 +++
+ src/hunspell/affixmgr.hxx |  1 +
+ 2 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/src/hunspell/affixmgr.cxx b/src/hunspell/affixmgr.cxx
+index 0992e6e..0950425 100644
+--- misc/hunspell-1.3.3/src/hunspell/affixmgr.cxx
 misc/build/hunspell-1.3.3/src/hunspell/affixmgr.cxx
+@@ -139,8 +139,9 @@ AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, 
int * md, const char * k
+   cpdvowels=NULL; // vowels (for calculating of Hungarian compounding limit, 
O(n) search! XXX)
+   cpdvowels_utf16=NULL; // vowels for UTF-8 encoding (bsearch instead of O(n) 
search)
+   cpdvowels_utf16_len=0; // vowels
+-  pfxappnd=NULL; // previous prefix for counting the syllables of prefix BUG
+-  sfxappnd=NULL; // previous suffix for counting a special syllables BUG
++  pfxappnd=NULL; // previous prefix for counting syllables of the prefix BUG
++  sfxappnd=NULL; // previous suffix for counting syllables of the suffix BUG
++  sfxextra=0; // modifier for syllable count of sfxappnd BUG
+   cpdsyllablenum=NULL; // syllable count incrementing flag
+   checknum=0; // checking numbers, and word with numbers
+   wordchars=NULL; // letters + spec. word characters
+@@ -1201,6 +1202,7 @@ struct hentry * AffixMgr::prefix_check(const char * 
word, int len, char in_compo
+ pfx = NULL;
+ pfxappnd = NULL;
+ sfxappnd = NULL;
++sfxextra = 0;
+ 
+ // first handle the special case of 0 length prefixes
+ PfxEntry * pe = pStart[0];
+@@ -1261,6 +1263,7 @@ struct hentry * AffixMgr::prefix_check_twosfx(const char 
* word, int len,
+ 
+ pfx = NULL;
+ sfxappnd = NULL;
++sfxextra = 0;
+ 
+ // first handle the special case of 0 length prefixes
+ PfxEntry * pe = pStart[0];
+@@ -1302,6 +1305,7 @@ char * AffixMgr::prefix_check_morph(const char * word, 
int len, char in_compound
+ 
+ pfx = NULL;
+ sfxappnd = NULL;
++sfxextra = 0;
+ 
+ // first handle the special case of 0 length prefixes
+ PfxEntry * pe = pStart[0];
+@@ -1353,6 +1357,7 @@ char * AffixMgr::prefix_check_twosfx_morph(const char * 
word, int len,
+ 
+ pfx = NULL;
+ sfxappnd = NULL;
++sfxextra = 0;
+ 
+ // first handle the special case of 0 length prefixes
+ PfxEntry * pe = pStart[0];
+@@ -1993,7 +1998,7 @@ struct hentry * AffixMgr::compound_check(const char * 
word, int len,
+ // XXX only second suffix (inflections, not derivations)
+ if (sfxappnd) {
+ char * tmp = myrevstrdup(sfxappnd);
+-numsyllable -= get_syllable(tmp, strlen(tmp));
++numsyllable -= get_syllable(tmp, strlen(tmp)) + sfxextra;
+ free(tmp);
+ }
+ 
+@@ -2512,7 +2517,7 @@ int AffixMgr::compound_check_morph(const char * word, 
int len,
+ // XXX only second suffix (inflections, not derivations)
+ if (sfxappnd) {
+ char * tmp = myrevstrdup(sfxappnd);
+-

[Libreoffice-commits] core.git: external/hunspell

2015-09-11 Thread Caolán McNamara
 external/hunspell/UnpackedTarball_hunspell.mk  |1 
 external/hunspell/hunspell-1.3.3-rhbz1261421.patch |  191 +
 2 files changed, 192 insertions(+)

New commits:
commit 064fd8342111bc62ba646e439c235bd495587a4a
Author: Caolán McNamara 
Date:   Fri Sep 11 13:46:39 2015 +0100

Resolves: rhbz#1261421 crash on mashing hangul korean keyboard

Change-Id: Ie066c7f83ad15bec198f2091a3b084468c502766

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index ecf7856..6ad31dd 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-fdo48017-wfopen.patch \
external/hunspell/hunspell-morph-overflow.patch \
external/hunspell/ubsan.patch.0 \
+   external/hunspell/hunspell-1.3.3-rhbz1261421.patch \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-1.3.3-rhbz1261421.patch 
b/external/hunspell/hunspell-1.3.3-rhbz1261421.patch
new file mode 100644
index 000..4354dd0
--- /dev/null
+++ b/external/hunspell/hunspell-1.3.3-rhbz1261421.patch
@@ -0,0 +1,191 @@
+From 97e079a23d459aeb6e64435350d7710c90dbca85 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= 
+Date: Fri, 11 Sep 2015 13:28:52 +0100
+Subject: [PATCH] Resolves: rhbz#1261421 crash on mashing hangul korean
+ keyboard
+
+---
+ src/hunspell/hunspell.cxx | 69 +++
+ src/hunspell/hunspell.hxx |  4 ++-
+ src/hunspell/replist.cxx  | 18 ++---
+ src/hunspell/replist.hxx  |  2 ++
+ src/tools/hunspell.cxx|  2 +-
+ 6 files changed, 78 insertions(+), 24 deletions(-)
+
+diff --git a/src/hunspell/hunspell.cxx b/src/hunspell/hunspell.cxx
+index 7fae54b..d8ef357 100644
+--- misc/hunspell-1.3.3/src/hunspell/hunspell.cxx
 misc/build/hunspell-1.3.3/src/hunspell/hunspell.cxx
+@@ -12,6 +12,7 @@
+ #endif
+ #include "csutil.hxx"
+ 
++#include 
+ #include 
+ 
+ Hunspell::Hunspell(const char * affpath, const char * dpath, const char * key)
+@@ -349,8 +350,13 @@ int Hunspell::spell(const char * word, int * info, char 
** root)
+ 
+   // input conversion
+   RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL;
+-  if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, , 
, );
+-  else wl = cleanword2(cw, word, unicw, , , );
++  int convstatus = rl ? rl->conv(word, wspace, MAXWORDUTF8LEN) : 0;
++  if (convstatus < 0)
++return 0;
++  else if (convstatus > 0)
++wl = cleanword2(cw, wspace, unicw, , , );
++  else
++wl = cleanword2(cw, word, unicw, , , );
+ 
+   if (wl == 0 || maxdic == 0) return 1;
+   if (root) *root = NULL;
+@@ -702,8 +708,13 @@ int Hunspell::suggest(char*** slst, const char * word)
+ 
+   // input conversion
+   RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL;
+-  if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, , 
, );
+-  else wl = cleanword2(cw, word, unicw, , , );
++  int convstatus = rl ? rl->conv(word, wspace, MAXWORDUTF8LEN) : 0;
++  if (convstatus < 0)
++return 0;
++  else if (convstatus > 0)
++wl = cleanword2(cw, wspace, unicw, , , );
++  else
++wl = cleanword2(cw, word, unicw, , , );
+ 
+   if (wl == 0) return 0;
+   int ns = 0;
+@@ -1020,7 +1031,7 @@ int Hunspell::suggest(char*** slst, const char * word)
+   // output conversion
+   rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL;
+   for (int j = 0; rl && j < ns; j++) {
+-if (rl->conv((*slst)[j], wspace)) {
++if (rl->conv((*slst)[j], wspace, MAXWORDUTF8LEN) > 0) {
+   free((*slst)[j]);
+   (*slst)[j] = mystrdup(wspace);
+ }
+@@ -1395,8 +1406,13 @@ int Hunspell::analyze(char*** slst, const char * word)
+ 
+   // input conversion
+   RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL;
+-  if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, , 
, );
+-  else wl = cleanword2(cw, word, unicw, , , );
++  int convstatus = rl ? rl->conv(word, wspace, MAXWORDUTF8LEN) : 0;
++  if (convstatus < 0)
++return 0;
++  else if (convstatus > 0)
++wl = cleanword2(cw, wspace, unicw, , , );
++  else
++wl = cleanword2(cw, word, unicw, , , );
+ 
+   if (wl == 0) {
+   if (abbv) {
+@@ -1684,12 +1700,16 @@ int Hunspell::get_langnum() const
+return langnum;
+ }
+ 
+-int Hunspell::input_conv(const char * word, char * dest)
++int Hunspell::input_conv(const char * word, char * dest, size_t destsize)
+ {
+   RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL;
+-  return (rl && rl->conv(word, dest));
++  return (rl && rl->conv(word, dest, destsize) > 0);
+ }
+ 
++int Hunspell::input_conv(const char * word, char * dest)
++{
++  return input_conv(word, dest, std::numeric_limits::max());
++}
+ 
+ // return the beginning of the element (attr == NULL) or the attribute
+ const char * Hunspell::get_xml_pos(const char * s, 

[Libreoffice-commits] core.git: external/hunspell sw/source vcl/generic

2015-03-03 Thread Michael Stahl
 external/hunspell/ExternalProject_hunspell.mk |1 -
 sw/source/core/text/frmform.cxx   |1 -
 vcl/generic/print/bitmap_gfx.cxx  |   10 ++
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 08ce45c94fcf3d5d0e937fb01e90f16ef4d9c88f
Author: Michael Stahl mst...@redhat.com
Date:   Mon Mar 2 21:17:10 2015 +0100

remove more SunStudio cruft

Change-Id: I1e1ca09e870461990c919938ed0902c8b90c4413

diff --git a/external/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
index 2b1ab8b..160f2b1 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -19,7 +19,6 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
./configure --disable-shared --disable-nls --with-pic \
$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM))\
$(if $(filter 
AIX,$(OS)),CFLAGS=-D_LINUX_SOURCE_COMPAT) \
-   $(if $(filter C53,$(COM)),CFLAGS=-xc99=none) \
$(if $(filter-out 
WNTGCC,$(OS)$(COM)),,LDFLAGS=-Wl,--enable-runtime-pseudo-reloc-v2) \
 $(MAKE) \
)
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 7e426fc..fc18196 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1267,7 +1267,6 @@ void SwTxtFrm::_Format( SwTxtFormatter rLine, 
SwTxtFormatInfo rInf,
 SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
 rLine.SetUnclipped( false );
 
-// That was too complicated for the C30: aString( GetTxt() );
 const OUString rString = GetTxtNode()-GetTxt();
 const sal_Int32 nStrLen = rString.getLength();
 
diff --git a/vcl/generic/print/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx
index 2811da8..ca6495f 100644
--- a/vcl/generic/print/bitmap_gfx.cxx
+++ b/vcl/generic/print/bitmap_gfx.cxx
@@ -33,8 +33,9 @@ const sal_uInt32 nBufferSize = 16384;
  *
  */
 
-PrinterBmp::~PrinterBmp ()
-{ /* dont need this, but C50 does */ }
+PrinterBmp::~PrinterBmp()
+{
+}
 
 /* virtual base class */
 
@@ -48,8 +49,9 @@ public:
 virtual ~ByteEncoder () = 0;
 };
 
-ByteEncoder::~ByteEncoder ()
-{ /* dont need this, but the C50 does */ }
+ByteEncoder::~ByteEncoder()
+{
+}
 
 /* HexEncoder */
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2015-01-13 Thread Stephan Bergmann
 external/hunspell/ubsan.patch.0 |   24 
 1 file changed, 24 insertions(+)

New commits:
commit 4cd1c4cb41316e16996a92695d86ac1d956d7e07
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jan 13 12:31:53 2015 +0100

external/hunspell: Work around -fsanitize=shift

Change-Id: I66ac6ec25615698382d065db2b782950cbc154e4

diff --git a/external/hunspell/ubsan.patch.0 b/external/hunspell/ubsan.patch.0
index 8749cd9..b52802d 100644
--- a/external/hunspell/ubsan.patch.0
+++ b/external/hunspell/ubsan.patch.0
@@ -9,3 +9,27 @@
  for (int i=0; i  4*word != 0; i++)
  hv = (hv  8) | (*word++);
  while (*word != 0) {
+--- src/hunspell/csutil.cxx
 src/hunspell/csutil.cxx
+@@ -147,7 +147,7 @@
+ case 0xd0: {// 2-byte UTF-8 codes
+ if ((*(u8+1)  0xc0) == 0x80) {
+ u2-h = (*u8  0x1f)  2;
+-u2-l = (*u8  6) + (*(u8+1)  0x3f);
++u2-l = (*reinterpret_castunsigned char const *(u8)  6) + 
(*(u8+1)  0x3f);
+ u8++;
+ } else {
+ HUNSPELL_WARNING(stderr, UTF-8 encoding error. Missing 
continuation byte in %ld. character position:\n%s\n, static_castlong(u8 - 
(signed char *)src), src);
+@@ -158,10 +158,10 @@
+ }
+ case 0xe0: {// 3-byte UTF-8 codes
+ if ((*(u8+1)  0xc0) == 0x80) {
+-u2-h = ((*u8  0x0f)  4) + ((*(u8+1)  0x3f)  2);
++u2-h = ((*reinterpret_castunsigned char const *(u8)  
0x0f)  4) + ((*(u8+1)  0x3f)  2);
+ u8++;
+ if ((*(u8+1)  0xc0) == 0x80) {
+-u2-l = (*u8  6) + (*(u8+1)  0x3f);
++u2-l = (*reinterpret_castunsigned char const *(u8)  
6) + (*(u8+1)  0x3f);
+ u8++;
+ } else {
+ HUNSPELL_WARNING(stderr, UTF-8 encoding error. Missing 
continuation byte in %ld. character position:\n%s\n, static_castlong(u8 - 
(signed char *)src), src);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2015-01-12 Thread Stephan Bergmann
 external/hunspell/UnpackedTarball_hunspell.mk |1 +
 external/hunspell/ubsan.patch.0   |   11 +++
 2 files changed, 12 insertions(+)

New commits:
commit 56dc9f6484985dd16274709c61d2ef640381dabd
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jan 12 10:32:59 2015 +0100

external/hunspell: Work around -fsanitize=shift

Change-Id: Id93e61a1b9893ae026056a9d3e03c88b259f0ff8

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 9acfd95..ecf7856 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-1.3.2-literal.patch \
external/hunspell/hunspell-fdo48017-wfopen.patch \
external/hunspell/hunspell-morph-overflow.patch \
+   external/hunspell/ubsan.patch.0 \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/ubsan.patch.0 b/external/hunspell/ubsan.patch.0
new file mode 100644
index 000..8749cd9
--- /dev/null
+++ b/external/hunspell/ubsan.patch.0
@@ -0,0 +1,11 @@
+--- src/hunspell/hashmgr.cxx
 src/hunspell/hashmgr.cxx
+@@ -479,7 +479,7 @@
+ 
+ int HashMgr::hash(const char * word) const
+ {
+-long  hv = 0;
++unsigned long  hv = 0;
+ for (int i=0; i  4*word != 0; i++)
+ hv = (hv  8) | (*word++);
+ while (*word != 0) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2014-09-26 Thread László Németh
 external/hunspell/UnpackedTarball_hunspell.mk   |1 
 external/hunspell/hunspell-morph-overflow.patch |   30 
 2 files changed, 31 insertions(+)

New commits:
commit b37a88c3080fc72f5f0ff9068bc71098be70ed11
Author: László Németh nem...@numbertext.org
Date:   Fri Sep 26 15:54:44 2014 +0200

Hunspell: fix buffer overflow during morphological analysis

affected: thesaurus usage in a Hungarian document

test case: press Ctrl+F7 on the word művészegyéniség

Change-Id: I024568e81265c4ce3e05f718bf9147229416ab73

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 96c85bb..9acfd95 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-1.3.2-nullptr.patch \
external/hunspell/hunspell-1.3.2-literal.patch \
external/hunspell/hunspell-fdo48017-wfopen.patch \
+   external/hunspell/hunspell-morph-overflow.patch \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-morph-overflow.patch 
b/external/hunspell/hunspell-morph-overflow.patch
new file mode 100644
index 000..fe7c4f7
--- /dev/null
+++ b/external/hunspell/hunspell-morph-overflow.patch
@@ -0,0 +1,30 @@
+--- hunspell/src/hunspell/affixmgr.cxx 2014-09-24 16:11:10.750421303 +0200
 build/hunspell/src/hunspell/affixmgr.cxx   2014-09-26 15:25:09.448688908 
+0200
+@@ -2400,8 +2400,10 @@
+   }
+   mystrcat(*result, presult, MAXLNLEN);
+   if (m || (*m != '\0')) {
+-sprintf(*result + strlen(*result), %c%s%s%s, 
MSEP_FLD,
++char m2[MAXLNLEN];
++sprintf(m2, %c%s%s%s, MSEP_FLD,
+ MORPH_PART, word + i, line_uniq_app(m, 
MSEP_REC));
++mystrcat(*result, m2, MAXLNLEN);
+   }
+   if (m) free(m);
+   mystrcat(*result, \n, MAXLNLEN);
+@@ -2481,11 +2483,13 @@
+   }
+   mystrcat(*result, presult, MAXLNLEN);
+   if (m  (*m != '\0')) {
+-sprintf(*result + strlen(*result), %c%s%s%s, 
MSEP_FLD,
++char m2[MAXLNLEN];
++sprintf(m2, %c%s%s%s, MSEP_FLD,
+ MORPH_PART, word + i, line_uniq_app(m, 
MSEP_REC));
++mystrcat(*result, m2, MAXLNLEN);
+   }
+   if (m) free(m);
+-  sprintf(*result + strlen(*result), %c, MSEP_REC);
++  if (strlen(*result) + 1  MAXLNLEN) sprintf(*result + 
strlen(*result), %c, MSEP_REC);
+   ok = 1;
+ }
+ 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell external/hyphen external/mythes

2014-07-20 Thread László Németh
 external/hunspell/hunspell-fdo48017-wfopen.patch |6 +++---
 external/hyphen/hyphen-fdo48017-wfopen.patch |   10 +++---
 external/mythes/mythes-fdo48017-wfopen.patch |9 +++--
 3 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit d7374d4812316a79916956f03c8bd4a281fdbdec
Author: László Németh nem...@numbertext.org
Date:   Sun Jul 20 13:46:57 2014 +0200

fdo#80363 _wfullpath in MyThes and Hyphen

Change-Id: I4232040d4c62220389ca356797d18b1c87673e64

diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch 
b/external/hunspell/hunspell-fdo48017-wfopen.patch
index e358106..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,26 @@
+@@ -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
  
@@ -24,11 +24,11 @@ diff -ru hunspell/src/hunspell/csutil.cxx 
build/hunspell/src/hunspell/csutil.cxx
 +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));
-+MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
 +FILE * f = NULL;
++MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
 +if (_wfullpath( buff2, buff, len ) != NULL) {
 +  f = _wfopen(buff2, (strcmp(mode, r) == 0) ? Lr : Lrb);
-+} 
++}
 +free(buff);
 +free(buff2);
 +return f;
diff --git a/external/hyphen/hyphen-fdo48017-wfopen.patch 
b/external/hyphen/hyphen-fdo48017-wfopen.patch
index 4bcf633..815eeda 100644
--- a/external/hyphen/hyphen-fdo48017-wfopen.patch
+++ b/external/hyphen/hyphen-fdo48017-wfopen.patch
@@ -13,7 +13,7 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c
  #define noVERBOSE
  
  /* calculate hyphenmin values with long ligature length (2 or 3 characters
-@@ -371,12 +376,28 @@
+@@ -371,12 +376,32 @@
}
  }
  
@@ -23,10 +23,14 @@ diff -u hyphen/hyphen.c build/hyphen/hyphen.c
 +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));
-+FILE * f;
++wchar_t *buff2 = (wchar_t *) malloc(len * sizeof(wchar_t));
++FILE * f = NULL;
 +MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
-+f = _wfopen(buff, (strcmp(mode, r) == 0) ? Lr : Lrb);
++if (_wfullpath( buff2, buff, len ) != NULL) {
++  f = _wfopen(buff2, (strcmp(mode, r) == 0) ? Lr : Lrb);
++}
 +free(buff);
++free(buff2);
 +return f;
 +}
 +#endif
diff --git a/external/mythes/mythes-fdo48017-wfopen.patch 
b/external/mythes/mythes-fdo48017-wfopen.patch
index 1621b1d..82d69ad 100644
--- a/external/mythes/mythes-fdo48017-wfopen.patch
+++ b/external/mythes/mythes-fdo48017-wfopen.patch
@@ -31,7 +31,7 @@ diff -u mythes/mythes.cxx build/mythes/mythes.cxx
  if (!pdfile) {
  return 0;
  } 
-@@ -370,3 +375,17 @@
+@@ -373,3 +378,22 @@
return -1;
  }
  
@@ -41,9 +41,14 @@ diff -u mythes/mythes.cxx build/mythes/mythes.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) ? Lr : Lrb);
++if (_wfullpath( buff2, buff, len ) != NULL) {
++  f = _wfopen(buff2, (strcmp(mode, r) == 0) ? Lr : Lrb);
++}
 +free(buff);
++free(buff2);
 +return f;
 +}
 +#endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell

2014-07-19 Thread László Németh
 external/hunspell/hunspell-fdo48017-wfopen.patch |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 7efd83bb29ef8be8c78c4da5452fe3293ed15ea4
Author: László Németh nem...@numbertext.org
Date:   Sat Jul 19 03:44:07 2014 +0200

fdo#80363 add _wfullpath to expand .. in dictionary paths

Change-Id: I6c9edd0b4d2c63f7735d090e5d2d72d5fb81b921
Reviewed-on: https://gerrit.libreoffice.org/10400
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..e358106 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 @@
+@@ -46,6 +50,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));
 +MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
-+FILE * f = _wfopen(buff, (strcmp(mode, r) == 0) ? Lr : Lrb);
++FILE * f = NULL;
++if (_wfullpath( buff2, buff, len ) != NULL) {
++  f = _wfopen(buff2, (strcmp(mode, r) == 0) ? Lr : Lrb);
++} 
 +free(buff);
++free(buff2);
 +return f;
 +}
 +#endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-25 Thread László Németh
 external/hunspell/UnpackedTarball_hunspell.mk|1 
 external/hunspell/hunspell-fdo48017-wfopen.patch |  109 +++
 lingucomponent/source/spellcheck/spell/sspellimp.cxx |   13 +-
 3 files changed, 117 insertions(+), 6 deletions(-)

New commits:
commit 5e4b21e2d627de0c815370ed886ff95675bf28d1
Author: László Németh nem...@numbertext.org
Date:   Fri Apr 25 12:09:52 2014 +0200

fdo#48017 fix WIN32 long path name support of spelling dictionaries

Change-Id: I1ccaae9dba4f82cd50531890e159519a765a0fff

diff --git a/external/hunspell/UnpackedTarball_hunspell.mk 
b/external/hunspell/UnpackedTarball_hunspell.mk
index 8c23f03..730a6ce 100644
--- a/external/hunspell/UnpackedTarball_hunspell.mk
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hunspell,\
external/hunspell/hunspell-1.3.2-compound.patch \
external/hunspell/hunspell.rhbz918938.patch \
external/hunspell/hunspell-wundef.patch.1 \
+   external/hunspell/hunspell-fdo48017-wfopen.patch \
 ))
 
 ifeq ($(COM),MSC)
diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch 
b/external/hunspell/hunspell-fdo48017-wfopen.patch
new file mode 100644
index 000..a2782e0
--- /dev/null
+++ b/external/hunspell/hunspell-fdo48017-wfopen.patch
@@ -0,0 +1,109 @@
+diff -ru hunspell/src/hunspell/csutil.cxx 
build/hunspell/src/hunspell/csutil.cxx
+--- hunspell/src/hunspell/csutil.cxx   2011-02-02 11:35:43.0 +0100
 build/hunspell/src/hunspell/csutil.cxx 2014-04-24 19:42:01.373285409 
+0200
+@@ -17,6 +17,10 @@
+   unsigned short clower;
+ };
+ 
++#ifdef _WIN32
++#include wchar.h
++#endif
++
+ #ifdef OPENOFFICEORG
+ #  include unicode/uchar.h
+ #else
+@@ -46,6 +50,21 @@
+ static struct unicode_info2 * utf_tbl = NULL;
+ static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell 
instances
+ 
++FILE * myfopen(const char * path, const char * mode) {
++#ifdef _WIN32
++#define WIN32_LONG_PATH_PREFIX ?\\
++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));
++MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
++FILE * f = _wfopen(buff, (strcmp(mode, r) == 0) ? Lr : Lrb);
++free(buff);
++return f;
++}
++#endif
++return fopen(path, mode);
++}
++
+ /* only UTF-16 (BMP) implementation */
+ char * u16_u8(char * dest, int size, const w_char * src, int srclen) {
+ signed char * u8 = (signed char *)dest;
+diff -ru hunspell/src/hunspell/csutil.hxx 
build/hunspell/src/hunspell/csutil.hxx
+--- hunspell/src/hunspell/csutil.hxx   2010-09-06 09:58:53.0 +0200
 build/hunspell/src/hunspell/csutil.hxx 2014-04-24 19:42:01.373285409 
+0200
+@@ -52,6 +52,9 @@
+ #define FORBIDDENWORD  65510
+ #define ONLYUPCASEFLAG 65511
+ 
++// fopen or optional _wfopen to fix long pathname problem of WIN32
++LIBHUNSPELL_DLL_EXPORTED FILE * myfopen(const char * path, const char * mode);
++
+ // convert UTF-16 characters to UTF-8
+ LIBHUNSPELL_DLL_EXPORTED char * u16_u8(char * dest, int size, const w_char * 
src, int srclen);
+ 
+diff -ru hunspell/src/hunspell/dictmgr.cxx 
build/hunspell/src/hunspell/dictmgr.cxx
+--- hunspell/src/hunspell/dictmgr.cxx  2010-06-02 21:33:59.0 +0200
 build/hunspell/src/hunspell/dictmgr.cxx2014-04-24 19:42:01.381285408 
+0200
+@@ -5,6 +5,7 @@
+ #include stdio.h
+ 
+ #include dictmgr.hxx
++#include csutil.hxx
+ 
+ DictMgr::DictMgr(const char * dictpath, const char * etype) : numdict(0)
+ {
+@@ -57,7 +58,7 @@
+ 
+ // open the dictionary list file
+ FILE * dictlst;
+-dictlst = fopen(dictpath,r);
++dictlst = myfopen(dictpath,r);
+ if (!dictlst) {
+   return 1;
+ }
+diff -ru hunspell/src/hunspell/filemgr.cxx 
build/hunspell/src/hunspell/filemgr.cxx
+--- hunspell/src/hunspell/filemgr.cxx  2010-04-14 11:42:03.0 +0200
 build/hunspell/src/hunspell/filemgr.cxx2014-04-25 00:44:05.049789586 
+0200
+@@ -6,6 +6,7 @@
+ #include stdio.h
+ 
+ #include filemgr.hxx
++#include csutil.hxx
+ 
+ int FileMgr::fail(const char * err, const char * par) {
+ fprintf(stderr, err, par);
+@@ -15,7 +16,7 @@
+ FileMgr::FileMgr(const char * file, const char * key) {
+ linenum = 0;
+ hin = NULL;
+-fin = fopen(file, r);
++fin = myfopen(file, r);
+ if (!fin) {
+ // check hzipped file
+ char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 
1);
+diff -ru hunspell/src/hunspell/hunzip.cxx 
build/hunspell/src/hunspell/hunzip.cxx
+--- hunspell/src/hunspell/hunzip.cxx   2010-04-27 16:07:14.0 +0200
 build/hunspell/src/hunspell/hunzip.cxx 2014-04-24 19:42:01.381285408 
+0200
+@@ -3,6 +3,7 @@
+ #include stdio.h 
+ 
+ #include hunzip.hxx
++#include csutil.hxx
+ 
+ #define CODELEN  65536
+ #define BASEBITREC 5000
+@@ -38,7 +38,7 @@
+ 
+ 

[Libreoffice-commits] core.git: external/hunspell

2014-04-25 Thread Caolán McNamara
 external/hunspell/hunspell-fdo48017-wfopen.patch |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 187765b8a45761e14d18da58463dbc0f5bd825e9
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Apr 25 16:38:16 2014 +0100

try including windows.h for MultiByteToWideChar

Change-Id: Ib737e520ff16f2e467504e85fc3969d525fd742a

diff --git a/external/hunspell/hunspell-fdo48017-wfopen.patch 
b/external/hunspell/hunspell-fdo48017-wfopen.patch
index a2782e0..47b803b 100644
--- a/external/hunspell/hunspell-fdo48017-wfopen.patch
+++ b/external/hunspell/hunspell-fdo48017-wfopen.patch
@@ -1,11 +1,12 @@
 diff -ru hunspell/src/hunspell/csutil.cxx 
build/hunspell/src/hunspell/csutil.cxx
 --- hunspell/src/hunspell/csutil.cxx   2011-02-02 11:35:43.0 +0100
 +++ build/hunspell/src/hunspell/csutil.cxx 2014-04-24 19:42:01.373285409 
+0200
-@@ -17,6 +17,10 @@
+@@ -17,6 +17,11 @@
unsigned short clower;
  };
  
 +#ifdef _WIN32
++#include windows.h
 +#include wchar.h
 +#endif
 +
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: external/hunspell external/Module_external.mk hunspell/ExternalProject_hunspell.mk hunspell/hunspell-1.3.2-compound.patch hunspell/hunspell-1.3.2-literal.patch hunspell

2013-10-18 Thread Khaled Hosny
 RepositoryModule_host.mk  |1 
 external/Module_external.mk   |1 
 external/hunspell/ExternalProject_hunspell.mk |   27 ++
 external/hunspell/Makefile|7 +
 external/hunspell/Module_hunspell.mk  |   25 ++
 external/hunspell/README  |4 
 external/hunspell/StaticLibrary_hunspell.mk   |   37 
 external/hunspell/UnpackedTarball_hunspell.mk |   32 +++
 external/hunspell/hunspell-1.3.2-compound.patch   |   11 ++
 external/hunspell/hunspell-1.3.2-literal.patch|   11 ++
 external/hunspell/hunspell-1.3.2-nullptr.patch|   20 
 external/hunspell/hunspell-1.3.2-overflow.patch   |   91 ++
 external/hunspell/hunspell-android.patch  |   42 ++
 external/hunspell/hunspell-solaris.patch  |   12 ++
 external/hunspell/hunspell-twoaffixcompound.patch |   80 +++
 external/hunspell/hunspell-wundef.patch.1 |   11 ++
 external/hunspell/hunspell.rhbz918938.patch   |   72 +
 hunspell/ExternalProject_hunspell.mk  |   27 --
 hunspell/Makefile |7 -
 hunspell/Module_hunspell.mk   |   27 --
 hunspell/README   |4 
 hunspell/StaticLibrary_hunspell.mk|   37 
 hunspell/UnpackedTarball_hunspell.mk  |   32 ---
 hunspell/hunspell-1.3.2-compound.patch|   11 --
 hunspell/hunspell-1.3.2-literal.patch |   11 --
 hunspell/hunspell-1.3.2-nullptr.patch |   20 
 hunspell/hunspell-1.3.2-overflow.patch|   91 --
 hunspell/hunspell-android.patch   |   42 --
 hunspell/hunspell-solaris.patch   |   12 --
 hunspell/hunspell-twoaffixcompound.patch  |   80 ---
 hunspell/hunspell-wundef.patch.1  |   11 --
 hunspell/hunspell.rhbz918938.patch|   72 -
 32 files changed, 483 insertions(+), 485 deletions(-)

New commits:
commit 64b6499371fa22d52648523e65a28c041dd6579f
Author: Khaled Hosny khaledho...@eglug.org
Date:   Thu Oct 17 19:58:07 2013 +0200

fdo#70393: move hunspell to a subdir of external

Change-Id: Id3aafd95cb8c064f84898844a91f350e9aad0ed4
Reviewed-on: https://gerrit.libreoffice.org/6307
Reviewed-by: David Tardon dtar...@redhat.com
Tested-by: David Tardon dtar...@redhat.com

diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 2fd2400..484d380 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -57,7 +57,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
framework \
$(call gb_Helper_optional,DESKTOP,helpcompiler) \
$(call gb_Helper_optional,HELP,helpcontent2) \
-   $(call gb_Helper_optional,HUNSPELL,hunspell) \
hwpfilter \
$(call gb_Helper_optional,HYPHEN,hyphen) \
i18nlangtag \
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 2b8e836..46bceaf 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,GRAPHITE,graphite) \
$(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
$(call gb_Helper_optional,HSQLDB,hsqldb) \
+   $(call gb_Helper_optional,HUNSPELL,hunspell) \
$(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \
$(call gb_Helper_optional,LIBPNG,libpng) \
 ))
diff --git a/hunspell/ExternalProject_hunspell.mk 
b/external/hunspell/ExternalProject_hunspell.mk
similarity index 100%
rename from hunspell/ExternalProject_hunspell.mk
rename to external/hunspell/ExternalProject_hunspell.mk
diff --git a/hunspell/Makefile b/external/hunspell/Makefile
similarity index 100%
rename from hunspell/Makefile
rename to external/hunspell/Makefile
diff --git a/hunspell/Module_hunspell.mk b/external/hunspell/Module_hunspell.mk
similarity index 94%
rename from hunspell/Module_hunspell.mk
rename to external/hunspell/Module_hunspell.mk
index 6acd732..505a9fb 100644
--- a/hunspell/Module_hunspell.mk
+++ b/external/hunspell/Module_hunspell.mk
@@ -9,7 +9,6 @@
 
 $(eval $(call gb_Module_Module,hunspell))
 
-ifeq ($(SYSTEM_HUNSPELL),NO)
 $(eval $(call gb_Module_add_targets,hunspell,\
UnpackedTarball_hunspell \
 ))
@@ -22,6 +21,5 @@ $(eval $(call gb_Module_add_targets,hunspell,\
ExternalProject_hunspell \
 ))
 endif
-endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/hunspell/README b/external/hunspell/README
similarity index 100%
rename from hunspell/README
rename to external/hunspell/README
diff --git a/hunspell/StaticLibrary_hunspell.mk 
b/external/hunspell/StaticLibrary_hunspell.mk
similarity index 100%
rename from hunspell/StaticLibrary_hunspell.mk
rename to