bump product version to 6.1.0.2
[LibreOffice.git] / external / hunspell / 0001-tdf-116586-fix-LibreOffice-crash-by-Hungarian-person.patch
blobe26ee735423bf97d4162769c0fffa7d0c30f4da8
1 From 987fd8c3ed648ca7d637f2dbb86e97c600954d2c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= <nemeth@numbertext.org>
3 Date: Sun, 25 Mar 2018 23:51:47 +0200
4 Subject: [PATCH] tdf#116586 fix LibreOffice crash by Hungarian personal
5 dictionary
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 "AkH. 11. (old orthography)", caused by bad handling of forbidden words
11 of alias compressed dictionaries during run-time dictionary extension.
13 Note: accepting also all – previously forbidden – affixed
14 forms of the modified stem is a removed function: "Grammar by" spell
15 checking (for example, in LibreOffice via SPELLML interface of Hunspell)
16 supports user words with affixation and compounding.
18 The original idea was to add substandard or interfering words
19 as forbidden words – but with flags – to the dictionary, and adding
20 the stem to the personal dictionary could “switch on” the affixed
21 forms of the word, too. Now the suggested method is using
22 "Grammar by" personal dictionaries, as in LibreOffice:
24 https://wiki.documentfoundation.org/ReleaseNotes/6.0#.E2.80.9CGrammar_By.E2.80.9D_spell_checking
25 ---
26 src/hunspell/hashmgr.cxx | 20 ++------------------
27 1 file changed, 2 insertions(+), 18 deletions(-)
29 diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx
30 index ec3803b..5183f02 100644
31 --- a/src/hunspell/hashmgr.cxx
32 +++ b/src/hunspell/hashmgr.cxx
33 @@ -506,24 +506,8 @@ int HashMgr::remove_forbidden_flag(const std::string& word) {
34 if (!dp)
35 return 1;
36 while (dp) {
37 - if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
38 - if (dp->alen == 1)
39 - dp->alen = 0; // XXX forbidden words of personal dic.
40 - else {
41 - unsigned short* flags2 =
42 - (unsigned short*)malloc(sizeof(unsigned short) * (dp->alen - 1));
43 - if (!flags2)
44 - return 1;
45 - int i, j = 0;
46 - for (i = 0; i < dp->alen; i++) {
47 - if (dp->astr[i] != forbiddenword)
48 - flags2[j++] = dp->astr[i];
49 - }
50 - dp->alen--;
51 - free(dp->astr);
52 - dp->astr = flags2; // XXX allowed forbidden words
53 - }
54 - }
55 + if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen))
56 + dp->alen = 0; // XXX forbidden words of personal dic.
57 dp = dp->next_homonym;
59 return 0;
60 --
61 2.7.4