summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMartin Hosken <martin_hosken@sil.org>2016-04-15 20:26:08 +0200
committerEike Rathke <erack@redhat.com>2016-04-18 12:50:32 +0000
commit4e066825d43400969041669c82d8a4e0bfd91adf (patch)
tree9dea6368f5c66a9b9d01b8b21b83803ba997c1aa /external
parent8a0e6b25219e59b12034348b8b264117059755ec (diff)
reactivate ICU Khmer patch
Patch has been upstreamed with https://ssl.icu-project.org/trac/ticket/12504 Change-Id: I1f3ddad87a2a6568ced3f9d2b2df3e0af0ee18aa Reviewed-on: https://gerrit.libreoffice.org/24117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Martin Hosken <martin_hosken@sil.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/icu/UnpackedTarball_icu.mk3
-rw-r--r--external/icu/khmerbreakengine.patch24
2 files changed, 15 insertions, 12 deletions
diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index c48d02556d2d..4a6a11477af3 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -27,6 +27,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
external/icu/clang-cl.patch.0 \
$(if $(filter-out ANDROID,$(OS)),external/icu/icu4c-icudata-stdlibs.diff) \
$(if $(filter EMSCRIPTEN,$(OS)),external/icu/icu4c-emscripten.patch.1) \
+ external/icu/khmerbreakengine.patch \
))
+$(eval $(call gb_UnpackedTarball_add_file,icu,source/data/brkitr/khmerdict.dict,external/icu/khmerdict.dict))
+
# vim: set noet sw=4 ts=4:
diff --git a/external/icu/khmerbreakengine.patch b/external/icu/khmerbreakengine.patch
index 0687645e8790..8f81f315da3e 100644
--- a/external/icu/khmerbreakengine.patch
+++ b/external/icu/khmerbreakengine.patch
@@ -478,9 +478,9 @@ index f1c874d..3ad1b3f 100644
- UChar32 uc;
- int32_t chars = 0;
- for (;;) {
-- int32_t pcIndex = utext_getNativeIndex(text);
+- int32_t pcIndex = (int32_t)utext_getNativeIndex(text);
- pc = utext_next32(text);
-- int32_t pcSize = utext_getNativeIndex(text) - pcIndex;
+- int32_t pcSize = (int32_t)utext_getNativeIndex(text) - pcIndex;
- chars += pcSize;
- remaining -= pcSize;
- if (remaining <= 0) {
@@ -1000,10 +1000,10 @@ index cb594c6..82f2e77 100644
+ int32_t *prefix, UnicodeSet const* ignoreSet, int32_t minLength) const {
UCharsTrie uct(characters);
- int32_t startingTextIndex = utext_getNativeIndex(text);
+ int32_t startingTextIndex = (int32_t)utext_getNativeIndex(text);
@@ -53,7 +53,13 @@ int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t
UStringTrieResult result = (codePointsMatched == 0) ? uct.first(c) : uct.next(c);
- int32_t lengthMatched = utext_getNativeIndex(text) - startingTextIndex;
+ int32_t lengthMatched = (int32_t)utext_getNativeIndex(text) - startingTextIndex;
codePointsMatched += 1;
+ if (ignoreSet != NULL && ignoreSet->contains(c)) {
+ continue;
@@ -1022,11 +1022,11 @@ index cb594c6..82f2e77 100644
- int32_t *prefix) const {
+ int32_t *prefix, UnicodeSet const* ignoreSet, int32_t minLength) const {
BytesTrie bt(characters);
- int32_t startingTextIndex = utext_getNativeIndex(text);
+ int32_t startingTextIndex = (int32_t)utext_getNativeIndex(text);
int32_t wordCount = 0;
@@ -120,7 +126,13 @@ int32_t BytesDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t
UStringTrieResult result = (codePointsMatched == 0) ? bt.first(transform(c)) : bt.next(transform(c));
- int32_t lengthMatched = utext_getNativeIndex(text) - startingTextIndex;
+ int32_t lengthMatched = (int32_t)utext_getNativeIndex(text) - startingTextIndex;
codePointsMatched += 1;
+ if (ignoreSet != NULL && ignoreSet->contains(c)) {
+ continue;
@@ -1081,7 +1081,7 @@ diff --git a/source/data/Makefile.in b/source/data/Makefile.in
index 816c82d..c637d70 100644
--- misc/icu/source/data/Makefile.in
+++ build/icu/source/data/Makefile.in
-@@ -179,7 +179,7 @@ endif
+@@ -181,7 +181,7 @@ endif
endif
endif
@@ -1090,17 +1090,17 @@ index 816c82d..c637d70 100644
ifneq ($(ENABLE_STATIC),)
ifeq ($(PKGDATA_MODE),dll)
$(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_VERSIONING) $(PKGDATA_LIST)
-@@ -563,8 +563,14 @@ $(BRKBLDDIR)/burmesedict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1000 -c -i $(BUILDDIR) $(BRKSRCDIR)/burmesedict.txt $(BRKBLDDIR)/burmesedict.dict
+@@ -564,8 +564,14 @@ $(BRKBLDDIR)/burmesedict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
+ $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1000 -c -i $(BUILDDIR) $(DICTSRCDIR)/burmesedict.txt $(BRKBLDDIR)/burmesedict.dict
# TODO: figure out why combining characters are here?
-$(BRKBLDDIR)/khmerdict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
-- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(BRKSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
+- $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(DICTSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
+#$(BRKBLDDIR)/khmerdict.dict: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(DAT_FILES)
-+# $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(BRKSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
++# $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(DICTSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
+
+#$(MAINBUILDDIR)/khmerdict.stamp: $(TOOLBINDIR)/gendict$(TOOLEXEEXT) $(BRKSRCDIR)/khmerdict.txt build-local
-+# $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(BRKSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
++# $(INVOKE) $(TOOLBINDIR)/gendict --bytes --transform offset-0x1780 -c -i $(BUILDDIR) $(DICTSRCDIR)/khmerdict.txt $(BRKBLDDIR)/khmerdict.dict
+$(MAINBUILDDIR)/khmerdict.stamp: $(BRKSRCDIR)/khmerdict.dict build-local
+ cp $< $(BRKBLDDIR)
+ echo "timestamp" > $@