[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - external/liblangtag i18nlangtag/qa

Eike Rathke erack at redhat.com
Fri Apr 11 04:28:26 PDT 2014


 external/liblangtag/UnpackedTarball_langtag.mk                                             |    1 
 external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch |   49 ++++++++++
 i18nlangtag/qa/cppunit/test_languagetag.cxx                                                |   11 ++
 3 files changed, 60 insertions(+), 1 deletion(-)

New commits:
commit 726c6146981ea6411b84dc3e9c13ad42a0baab06
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Apr 5 20:04:37 2014 +0200

    include last record in language-subtag-registry.xml
    
    (cherry picked from commit f854b05013a587a6ea568b32180f5c81de26eeeb)
    
    disable test and document why
    
    disable build breaker test
    
    (cherry picked from commit 73c70f28ba41c7a602d7befde84c5b54187694d7)
    
    document why the test fails and is disabled
    
    (cherry picked from commit 2803e5c1e7112882003c3e2301f8e28f3dc2b6b7)
    
    Change-Id: Iaca0fc9ca12ee672f640be9c639b7b0d0dd3bc10
    Reviewed-on: https://gerrit.libreoffice.org/8921
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/external/liblangtag/UnpackedTarball_langtag.mk b/external/liblangtag/UnpackedTarball_langtag.mk
index 7637ee9..90068cb 100644
--- a/external/liblangtag/UnpackedTarball_langtag.mk
+++ b/external/liblangtag/UnpackedTarball_langtag.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,langtag,\
 	external/liblangtag/liblangtag-0.5.1-undefined-have-sys-param-h.patch \
 	external/liblangtag/liblangtag-0.5.1-windows-do-not-prepend-dir-separator.patch \
 	external/liblangtag/liblangtag-0.5.1-unistd.patch \
+	external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch \
 ))
 
 ifeq ($(OS),WNT)
diff --git a/external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch b/external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch
new file mode 100644
index 0000000..c28727c3b
--- /dev/null
+++ b/external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch
@@ -0,0 +1,49 @@
+Upstream 6564b87c2f6dac2482e530bc43b038a3e93a0e07
+resolves #6, include last record in language-subtag-registry.xml
+
+The '%%' in language-subtag-registry is a record delimiter, not record
+end marker, it is not present on the last record at file end.
+
+(cherry picked from commit 4fff73a834f94a7ca256c086d99ea0a654a6c287)
+
+diff --git a/data/reg2xml.c b/data/reg2xml.c
+--- UnpackedTarball/langtag.orig/data/reg2xml.c
++++ UnpackedTarball/langtag/data/reg2xml.c
+@@ -48,6 +48,7 @@ _parse(const char *filename,
+ 	FILE *fp;
+ 	char buffer[1024], *range = NULL, *begin = NULL, *end = NULL;
+ 	lt_bool_t in_entry = FALSE;
++	lt_bool_t file_end = FALSE;
+ 	xmlNodePtr ent = NULL;
+ 
+ 	if ((fp = fopen(filename, "rb")) == NULL) {
+@@ -56,10 +57,13 @@ _parse(const char *filename,
+ 	}
+ 	while (1) {
+ 		fgets(buffer, 1024, fp);
+-		if (feof(fp))
+-			break;
++		if (feof(fp)) {
++            if (!in_entry)
++                break;
++            file_end = TRUE;
++        }
+ 		_drop_crlf(buffer);
+-		if (lt_strcmp0(buffer, "%%") == 0) {
++		if (lt_strcmp0(buffer, "%%") == 0 || file_end) {
+ 			if (in_entry) {
+ 				if (ent) {
+ 					if (range) {
+@@ -102,7 +106,7 @@ _parse(const char *filename,
+ 				ent = NULL;
+ 				range = NULL;
+ 			}
+-			in_entry = TRUE;
++			in_entry = !file_end;
+ 		} else {
+ 			if (!in_entry) {
+ 				/* ignore it */
+
+--------------erAck-patch-parts--
+
+
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx
index 8946969..065a9d9 100644
--- a/i18nlangtag/qa/cppunit/test_languagetag.cxx
+++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx
@@ -444,7 +444,15 @@ void TestLanguageTag::testAllTags()
     }
 
 #if USE_LIBLANGTAG
-    // 'zh-yue-HK' uses extlang and should be preferred 'yue-HK'
+    // 'zh-yue-HK' uses redundant 'zh-yue' and should be preferred 'yue-HK'
+#if 0
+    /* XXX Disabled because liblangtag in lt_tag_canonicalize() after replacing
+     * 'zh-yue' with the preferred 'yue' does:
+     * "If the language tag starts with a primary language subtag that is also
+     * an extlang subtag, then the language tag is prepended with the extlang's
+     * 'Prefix'."
+     * Primary language 'yue' is also extlang 'yue' for which the prefix
+     * happens to be 'zh' ... so the result is 'zh-yue-HK' again. */
     {
         OUString s_zh_yue_HK( "zh-yue-HK" );
         LanguageTag zh_yue_HK( s_zh_yue_HK );
@@ -465,6 +473,7 @@ void TestLanguageTag::testAllTags()
         CPPUNIT_ASSERT( zh_yue_HK_Fallbacks[1] == "yue");
     }
 #endif
+#endif
 
     // 'qtz' is a local use known pseudolocale for key ID resource
     {


More information about the Libreoffice-commits mailing list