Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4200
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/00/4200/1
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
---
M libexttextcat/UnpackedTarball_exttextcat.mk
D libexttextcat/unkown.patch.1
M lingucomponent/source/languageguessing/guess.cxx
3 files changed, 9 insertions(+), 72 deletions(-)
diff --git a/libexttextcat/UnpackedTarball_exttextcat.mk
b/libexttextcat/UnpackedTarball_exttextcat.mk
index c6fa03c..ef90108 100644
--- a/libexttextcat/UnpackedTarball_exttextcat.mk
+++ b/libexttextcat/UnpackedTarball_exttextcat.mk
@@ -13,7 +13,6 @@
$(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 7311758..0000000
--- 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 6d7b61e..f1e54179 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 @@
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;
--
To view, visit https://gerrit.libreoffice.org/4200
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0c56474e5ff20c092c99c1648cd15b97149041f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Mark Wielaard <mark@klomp.org>
Context
- [PATCH] Use a simpler fix for bad old libexttextcat constants. · Mark Wielaard (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.