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 /lingucomponent/source | |
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>
Diffstat (limited to 'lingucomponent/source')
-rw-r--r-- | lingucomponent/source/languageguessing/guess.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
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; |