diff options
author | Mark Wielaard <mark@klomp.org> | 2013-06-08 22:14:28 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-06-10 05:02:52 +0000 |
commit | 9e958cd987be307e73467d168ae1d323d775e187 (patch) | |
tree | 85c49fc92a7128ac9de5233dcf384b94d869f4f7 | |
parent | a775188f6bbf3bbf8448b2b7398a1902908bb5e2 (diff) |
Use a simpler fix for bad old libexttextcat constants.
Don't patch the upstream sources. Don't do version dependend checks.
Just define the missing constants ourselves if they are missing.
Change-Id: Ie0c56474e5ff20c092c99c1648cd15b97149041f
Reviewed-on: https://gerrit.libreoffice.org/4200
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r-- | libexttextcat/UnpackedTarball_exttextcat.mk | 1 | ||||
-rw-r--r-- | libexttextcat/unkown.patch.1 | 60 | ||||
-rw-r--r-- | lingucomponent/source/languageguessing/guess.cxx | 20 |
3 files changed, 9 insertions, 72 deletions
diff --git a/libexttextcat/UnpackedTarball_exttextcat.mk b/libexttextcat/UnpackedTarball_exttextcat.mk index c6fa03cca3f6..ef90108f2913 100644 --- a/libexttextcat/UnpackedTarball_exttextcat.mk +++ b/libexttextcat/UnpackedTarball_exttextcat.mk @@ -13,7 +13,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,exttextcat,$(LIBEXTTEXTCAT_TARBALL) $(eval $(call gb_UnpackedTarball_add_patches,exttextcat,\ libexttextcat/android.patch \ - libexttextcat/unkown.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/libexttextcat/unkown.patch.1 b/libexttextcat/unkown.patch.1 deleted file mode 100644 index 731175817a73..000000000000 --- a/libexttextcat/unkown.patch.1 +++ /dev/null @@ -1,60 +0,0 @@ -diff -ur exttextcat.old/configure exttextcat/configure ---- exttextcat.old/configure 2012-06-28 10:17:56.000000000 +0200 -+++ exttextcat/configure 2013-03-25 18:58:00.520816594 +0100 -@@ -11776,9 +11776,9 @@ - - EXTTEXTCAT_MINOR_VERSION=4 - --EXTTEXTCAT_MICRO_VERSION=0 -+EXTTEXTCAT_MICRO_VERSION=1 - --EXTTEXTCAT_VERSION=3.4.0 -+EXTTEXTCAT_VERSION=3.4.1 - - - ac_config_files="$ac_config_files libexttextcat.pc Makefile langclass/Makefile langclass/LM/Makefile langclass/ShortTexts/Makefile src/Makefile src/exttextcat-version.h src/test-primary.sh src/test-secondary.sh" -diff -ur exttextcat.old/src/exttextcat-version.h exttextcat/src/exttextcat-version.h ---- exttextcat.old/src/exttextcat-version.h 2013-02-07 21:58:20.519793018 +0100 -+++ exttextcat/src/exttextcat-version.h 2013-03-25 21:40:24.822732870 +0100 -@@ -1,9 +1,9 @@ - #ifndef EXTTEXTCAT_VERSION_H - #define EXTTEXTCAT_VERSION_H - --#define EXTTEXTCAT_VERSION "3.4.0" -+#define EXTTEXTCAT_VERSION "3.4.1" - #define EXTTEXTCAT_VERSION_MAJOR 3 - #define EXTTEXTCAT_VERSION_MINOR 4 --#define EXTTEXTCAT_VERSION_MICRO 0 -+#define EXTTEXTCAT_VERSION_MICRO 1 - - #endif -diff -ur exttextcat.old/src/textcat.c exttextcat/src/textcat.c ---- exttextcat.old/src/textcat.c 2012-11-01 15:40:35.000000000 +0100 -+++ exttextcat/src/textcat.c 2013-03-25 16:22:57.226896529 +0100 -@@ -274,10 +274,10 @@ - switch (cnt) - { - case TEXTCAT_RESULT_UNKOWN: -- result = _TEXTCAT_RESULT_UNKOWN; -+ result = TEXTCAT_RESULT_UNKNOWN_STR; - break; - case TEXTCAT_RESULT_SHORT: -- result = _TEXTCAT_RESULT_SHORT; -+ result = TEXTCAT_RESULT_SHORT_STR; - break; - default: - { -diff -ur exttextcat.old/src/textcat.h exttextcat/src/textcat.h ---- exttextcat.old/src/textcat.h 2012-01-13 22:04:24.000000000 +0100 -+++ exttextcat/src/textcat.h 2013-03-25 16:22:11.131896925 +0100 -@@ -40,8 +40,8 @@ - #include "common.h" - #include "textcat_properties.h" - --#define _TEXTCAT_RESULT_UNKOWN "UNKNOWN" --#define _TEXTCAT_RESULT_SHORT "SHORT" -+#define TEXTCAT_RESULT_UNKNOWN_STR "UNKNOWN" -+#define TEXTCAT_RESULT_SHORT_STR "SHORT" - #define TEXTCAT_RESULT_UNKOWN 0 - #define TEXTCAT_RESULT_SHORT -2 - diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx index 6d7b61e17515..f1e54179a26f 100644 --- a/lingucomponent/source/languageguessing/guess.cxx +++ b/lingucomponent/source/languageguessing/guess.cxx @@ -29,6 +29,15 @@ #include <altstrfunc.hxx> #include <guess.hxx> +/* Old textcat.h versions defined bad spelled constants. */ +#ifndef TEXTCAT_RESULT_UNKNOWN_STR +#define TEXTCAT_RESULT_UNKNOWN_STR _TEXTCAT_RESULT_UNKOWN +#endif + +#ifndef TEXTCAT_RESULT_SHORT_STR +#define TEXTCAT_RESULT_SHORT_STR _TEXTCAT_RESULT_SHORT +#endif + using namespace std; Guess::Guess() @@ -53,20 +62,9 @@ Guess::Guess(const char * guess_str) string enc; //if the guess is not like "UNKNOWN" or "SHORT", go into the brackets -// if(strncmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_UNKNOWN, strlen(_TEXTCAT_RESULT_UNKNOWN)) != 0 -// && -// strncmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT, strlen(_TEXTCAT_RESULT_SHORT)) != 0) -// { -// FIXME just a temporary check until new version with renamed macros deployed -#if EXTTEXTCAT_VERSION_MAJOR > 3 || (EXTTEXTCAT_VERSION_MAJOR == 3 && (EXTTEXTCAT_VERSION_MINOR > 4 || (EXTTEXTCAT_VERSION_MINOR == 4 && (EXTTEXTCAT_VERSION_MICRO >= 1)))) if(strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_UNKNOWN_STR) != 0 && strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_SHORT_STR) != 0) -#else - if(strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_UNKOWN) != 0 - && - strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT) != 0) -#endif { int current_pointer = 0; |