summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2012-09-13 09:53:44 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-09-14 08:37:27 +0000
commit3d654071413bc107e0730dd31261c252f71572bf (patch)
treebe2bdd503f3553f09cb1b6909dc50f44d5d40ad2
parent73c6ec2e66c1402367a575c68c7c356654a74bff (diff)
fdo#54843 righthyphenmin fix (patch by Steven Dickson)
Change-Id: I42747dffef099f3806178af76e20335f5f033379 Reviewed-on: https://gerrit.libreoffice.org/606 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--hyphen/hyphen-rhmin.patch27
-rw-r--r--hyphen/makefile.mk3
2 files changed, 29 insertions, 1 deletions
diff --git a/hyphen/hyphen-rhmin.patch b/hyphen/hyphen-rhmin.patch
new file mode 100644
index 000000000000..12fff19f4466
--- /dev/null
+++ b/hyphen/hyphen-rhmin.patch
@@ -0,0 +1,27 @@
+--- misc//hyphen-2.8.4/hyphen.c
++++ misc/build/hyphen-2.8.4/hyphen.c
+@@ -734,13 +734,13 @@
+ int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens,
+ char *** rep, int ** pos, int ** cut, int rhmin)
+ {
+- int i = 1;
++ int i = 0;
+ int j;
+
+ // ignore numbers
+ for (j = word_size - 1; j > 0 && word[j] <= '9' && word[j] >= '0'; j--) i--;
+
+- for (j = word_size - 2; i < rhmin && j > 0; j--) {
++ for (j = word_size - 1; i < rhmin && j > 0; j--) {
+ // check length of the non-standard part
+ if (*rep && *pos && *cut && (*rep)[j]) {
+ char * rh = strchr((*rep)[j], '=');
+@@ -753,7 +753,7 @@
+ } else {
+ hyphens[j] = '0';
+ }
+- if (!utf8 || (word[j] & 0xc0) != 0xc0) i++;
++ if (!utf8 || (word[j] & 0xc0) == 0xc0 || (word[j] & 0x80) != 0x80) i++;
+ }
+ return 0;
+ }
diff --git a/hyphen/makefile.mk b/hyphen/makefile.mk
index 34dd6b59b0fe..bfbd320dfc0a 100644
--- a/hyphen/makefile.mk
+++ b/hyphen/makefile.mk
@@ -45,7 +45,8 @@ PATCH_FILES= \
hyphen-build.patch \
hyphen-android.patch \
hyphen-fdo43931.patch \
- hyphen-lenwaswrong.patch
+ hyphen-lenwaswrong.patch \
+ hyphen-rhmin.patch
.IF "$(GUI)"=="UNX"
CONFIGURE_DIR=$(BUILD_DIR)