diff options
author | Taichi Haradaguchi <20001722@ymail.ne.jp> | 2023-07-08 23:50:10 +0900 |
---|---|---|
committer | Taichi Haradaguchi <20001722@ymail.ne.jp> | 2023-07-11 12:44:02 +0200 |
commit | 09c6ef36f43a9c7cc594c7e2d4044fee41a96406 (patch) | |
tree | 0cd29f9092c93881a2dc233a004d70b4dd15fda4 | |
parent | e339b3dea0c48aa9598a4e202b18519a494e86c1 (diff) |
zxing-cpp: upgrade to release 2.1.0
- remove external/zxing/invalid_argument.patch.1 and
external/zxing/no_sanitize_ignored.patch.0, no longer needed in 2.1.0.
- If "Utf.h" can be included, use ZXing::FromUtf8() instaed of
ZXing::TextUtfEncoding::FromUtf8().
This makes external/zxing/undeprecate-warning.patch.0 unnecessary.
Change-Id: I06acebb623aa8b60c5d2e5f7f265998571d75a89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154221
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
-rw-r--r-- | cui/source/dialogs/QrCodeGenDialog.cxx | 11 | ||||
-rw-r--r-- | download.lst | 4 | ||||
-rw-r--r-- | external/zxing/StaticLibrary_zxing.mk | 22 | ||||
-rw-r--r-- | external/zxing/UnpackedTarball_zxing.mk | 3 | ||||
-rw-r--r-- | external/zxing/inc/pch/precompiled_zxing.hxx | 3 | ||||
-rw-r--r-- | external/zxing/invalid_argument.patch.1 | 22 | ||||
-rw-r--r-- | external/zxing/no_sanitize_ignored.patch.0 | 24 | ||||
-rw-r--r-- | external/zxing/undeprecate-warning.patch.0 | 14 |
8 files changed, 25 insertions, 78 deletions
diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx index 887ccaf44de4..0058ea362128 100644 --- a/cui/source/dialogs/QrCodeGenDialog.cxx +++ b/cui/source/dialogs/QrCodeGenDialog.cxx @@ -29,7 +29,6 @@ #include <BarcodeFormat.h> #include <BitMatrix.h> #include <MultiFormatWriter.h> -#include <TextUtfEncoding.h> #ifdef __GNUC__ #pragma GCC diagnostic pop @@ -39,6 +38,12 @@ #include <BitMatrixIO.h> #endif +#if __has_include(<Utf.h>) +#include <Utf.h> +#else +#include <TextUtfEncoding.h> +#endif + #endif // ENABLE_ZXING #include <com/sun/star/beans/XPropertySet.hpp> @@ -148,7 +153,11 @@ OString GenerateQRCode(std::u16string_view aQRText, tools::Long aQRECC, int aQRB ZXing::BarcodeFormat format = ZXing::BarcodeFormatFromString(GetBarCodeType(aQRType)); auto writer = ZXing::MultiFormatWriter(format).setMargin(aQRBorder).setEccLevel(bqrEcc); writer.setEncoding(ZXing::CharacterSet::UTF8); +#if __has_include(<Utf.h>) + ZXing::BitMatrix bitmatrix = writer.encode(ZXing::FromUtf8(QRText), 0, 0); +#else ZXing::BitMatrix bitmatrix = writer.encode(ZXing::TextUtfEncoding::FromUtf8(QRText), 0, 0); +#endif #if HAVE_ZXING_TOSVG return OString(ZXing::ToSVG(bitmatrix)); #else diff --git a/download.lst b/download.lst index 90d2341fefa7..18cba62be184 100644 --- a/download.lst +++ b/download.lst @@ -565,8 +565,8 @@ ZMF_TARBALL := libzmf-0.0.2.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -ZXING_SHA256SUM := 12b76b7005c30d34265fc20356d340da179b0b4d43d2c1b35bcca86776069f76 -ZXING_TARBALL := zxing-cpp-2.0.0.tar.gz +ZXING_SHA256SUM := 6d54e403592ec7a143791c6526c1baafddf4c0897bb49b1af72b70a0f0c4a3fe +ZXING_TARBALL := zxing-cpp-2.1.0.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/zxing/StaticLibrary_zxing.mk b/external/zxing/StaticLibrary_zxing.mk index 431d523a49b3..f9d031e35541 100644 --- a/external/zxing/StaticLibrary_zxing.mk +++ b/external/zxing/StaticLibrary_zxing.mk @@ -79,29 +79,29 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\ UnpackedTarball/zxing/core/src/oned/ODDataBarReader \ UnpackedTarball/zxing/core/src/oned/ODEAN8Writer \ UnpackedTarball/zxing/core/src/oned/ODEAN13Writer \ - UnpackedTarball/zxing/core/src/oned/ODITFWriter \ UnpackedTarball/zxing/core/src/oned/ODITFReader \ + UnpackedTarball/zxing/core/src/oned/ODITFWriter \ UnpackedTarball/zxing/core/src/oned/ODMultiUPCEANReader \ + UnpackedTarball/zxing/core/src/oned/ODUPCEANCommon \ UnpackedTarball/zxing/core/src/oned/ODUPCAWriter \ UnpackedTarball/zxing/core/src/oned/ODUPCEWriter \ - UnpackedTarball/zxing/core/src/oned/ODUPCEANCommon \ UnpackedTarball/zxing/core/src/oned/ODRowReader \ UnpackedTarball/zxing/core/src/oned/ODReader \ UnpackedTarball/zxing/core/src/oned/ODWriterHelper \ + UnpackedTarball/zxing/core/src/pdf417/PDFBarcodeValue \ + UnpackedTarball/zxing/core/src/pdf417/PDFBoundingBox \ UnpackedTarball/zxing/core/src/pdf417/PDFCodewordDecoder \ - UnpackedTarball/zxing/core/src/pdf417/PDFHighLevelEncoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFDecoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFDetector \ + UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResult \ UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResultColumn \ + UnpackedTarball/zxing/core/src/pdf417/PDFEncoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFHighLevelEncoder \ + UnpackedTarball/zxing/core/src/pdf417/PDFModulusGF \ + UnpackedTarball/zxing/core/src/pdf417/PDFModulusPoly \ UnpackedTarball/zxing/core/src/pdf417/PDFReader \ - UnpackedTarball/zxing/core/src/pdf417/PDFBoundingBox \ UnpackedTarball/zxing/core/src/pdf417/PDFScanningDecoder \ - UnpackedTarball/zxing/core/src/pdf417/PDFModulusGF \ - UnpackedTarball/zxing/core/src/pdf417/PDFEncoder \ - UnpackedTarball/zxing/core/src/pdf417/PDFDecodedBitStreamParser \ UnpackedTarball/zxing/core/src/pdf417/PDFWriter \ - UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResult \ - UnpackedTarball/zxing/core/src/pdf417/PDFModulusPoly \ - UnpackedTarball/zxing/core/src/pdf417/PDFDetector \ - UnpackedTarball/zxing/core/src/pdf417/PDFBarcodeValue \ UnpackedTarball/zxing/core/src/PerspectiveTransform \ UnpackedTarball/zxing/core/src/qrcode/QRBitMatrixParser \ UnpackedTarball/zxing/core/src/qrcode/QRCodecMode \ diff --git a/external/zxing/UnpackedTarball_zxing.mk b/external/zxing/UnpackedTarball_zxing.mk index ac3cd988eccb..fcdc303880c9 100644 --- a/external/zxing/UnpackedTarball_zxing.mk +++ b/external/zxing/UnpackedTarball_zxing.mk @@ -14,9 +14,6 @@ $(eval $(call gb_UnpackedTarball_set_tarball,zxing,$(ZXING_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,zxing,1)) $(eval $(call gb_UnpackedTarball_add_patches,zxing, \ - external/zxing/undeprecate-warning.patch.0 \ - external/zxing/no_sanitize_ignored.patch.0 \ - external/zxing/invalid_argument.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/zxing/inc/pch/precompiled_zxing.hxx b/external/zxing/inc/pch/precompiled_zxing.hxx index 5874187192ac..a414646f118b 100644 --- a/external/zxing/inc/pch/precompiled_zxing.hxx +++ b/external/zxing/inc/pch/precompiled_zxing.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2023-02-24 12:48:45 using: + Generated on 2023-07-09 00:00:16 using: ./bin/update_pch external/zxing zxing --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -26,6 +26,7 @@ #include <array> #include <cassert> #include <cctype> +#include <climits> #include <cmath> #include <cstddef> #include <cstdint> diff --git a/external/zxing/invalid_argument.patch.1 b/external/zxing/invalid_argument.patch.1 deleted file mode 100644 index 66794583c19c..000000000000 --- a/external/zxing/invalid_argument.patch.1 +++ /dev/null @@ -1,22 +0,0 @@ -From 302e8210b865576b35164f48bd57e003f6674dd1 Mon Sep 17 00:00:00 2001 -From: FalsinSoft <falsinsoft@gmail.com> -Date: Wed, 11 Jan 2023 20:58:04 +0100 -Subject: [PATCH] Fixed 'invalid_argument' is not a member of 'std' error on - Visual Studio - ---- - core/src/Matrix.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/core/src/Matrix.h b/core/src/Matrix.h -index 8b04bb1af..0c7c4e88b 100644 ---- a/core/src/Matrix.h -+++ b/core/src/Matrix.h -@@ -9,6 +9,7 @@ - #include "Point.h" - #include "ZXAlgorithms.h" - -+#include <stdexcept> - #include <algorithm> - #include <cassert> - #include <vector> diff --git a/external/zxing/no_sanitize_ignored.patch.0 b/external/zxing/no_sanitize_ignored.patch.0 deleted file mode 100644 index 692695e50a75..000000000000 --- a/external/zxing/no_sanitize_ignored.patch.0 +++ /dev/null @@ -1,24 +0,0 @@ ---- core/src/Matrix.h 2023-02-24 14:46:06.244773735 +0000 -+++ core/src/Matrix.h 2023-02-24 14:46:12.619482571 +0000 -@@ -34,9 +34,6 @@ - public: - Matrix() = default; - --#ifdef __GNUC__ -- __attribute__((no_sanitize("signed-integer-overflow"))) --#endif - Matrix(int width, int height, value_t val = {}) : _width(width), _height(height), _data(_width * _height, val) { - if (width != 0 && Size(_data) / width != height) - throw std::invalid_argument("invalid size: width * height is too big"); ---- core/src/BitMatrix.h 2023-02-24 15:56:00.813976749 +0000 -+++ core/src/BitMatrix.h 2023-02-24 15:56:18.740156420 +0000 -@@ -57,9 +57,6 @@ - public: - BitMatrix() = default; - --#ifdef __GNUC__ -- __attribute__((no_sanitize("signed-integer-overflow"))) --#endif - BitMatrix(int width, int height) : _width(width), _height(height), _bits(width * height, UNSET_V) - { - if (width != 0 && Size(_bits) / width != height) diff --git a/external/zxing/undeprecate-warning.patch.0 b/external/zxing/undeprecate-warning.patch.0 deleted file mode 100644 index c955396709bc..000000000000 --- a/external/zxing/undeprecate-warning.patch.0 +++ /dev/null @@ -1,14 +0,0 @@ ---- core/src/TextUtfEncoding.h 2023-02-24 11:30:34.505322162 +0000 -+++ core/src/TextUtfEncoding.h 2023-02-24 11:30:40.425049296 +0000 -@@ -12,8 +12,8 @@ - - // The following functions are not required anymore after Result::text() now returns utf8 natively and the encoders accept utf8 as well. - --[[deprecated]] std::string ToUtf8(std::wstring_view str); --[[deprecated]] std::string ToUtf8(std::wstring_view str, const bool angleEscape); --[[deprecated]] std::wstring FromUtf8(std::string_view utf8); -+std::string ToUtf8(std::wstring_view str); -+std::string ToUtf8(std::wstring_view str, const bool angleEscape); -+std::wstring FromUtf8(std::string_view utf8); - - } // namespace ZXing::TextUtfEncoding |