download.lst                                        |    4 +--
 external/zxing/StaticLibrary_zxing.mk               |   19 ++++-----------
 external/zxing/UnpackedTarball_zxing.mk             |   13 +---------
 external/zxing/android_include.patch.0              |   10 --------
 external/zxing/assume.__cpp_lib_string_view.patch.0 |   25 --------------------
 external/zxing/coroutine.patch.0                    |   11 --------
 external/zxing/inc/pch/precompiled_zxing.hxx        |   14 +----------
 external/zxing/missing-include.patch.0              |   12 ---------
 external/zxing/msvc-lambdacapture.patch.0           |   11 --------
 external/zxing/no_sanitize_ignored.patch.0          |   24 +++++++++++++++++++
 external/zxing/undeprecate-warning.patch.0          |   14 +++++++++++
 11 files changed, 50 insertions(+), 107 deletions(-)

New commits:
commit b16f5e374eb7e7199d4506eb04a3c3223dd52257
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Feb 24 10:59:17 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Feb 24 20:09:12 2023 +0000

    upgrade zxing-cpp to 2.0.0
    
    Change-Id: I3dc00f34359ec56a22cf7d8ba8e565ccb755c755
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147619
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/download.lst b/download.lst
index 49f98fae9188..7a5030a05adf 100644
--- a/download.lst
+++ b/download.lst
@@ -560,8 +560,8 @@ ZMF_TARBALL := libzmf-0.0.2.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-ZXING_SHA256SUM := 
126767bb56f8a1f25ae84d233db2e9b9be50d71f5776092d0e170ca0f0ed1862
-ZXING_TARBALL := zxing-cpp-1.4.0.tar.gz
+ZXING_SHA256SUM := 
12b76b7005c30d34265fc20356d340da179b0b4d43d2c1b35bcca86776069f76
+ZXING_TARBALL := zxing-cpp-2.0.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 debc137abb98..431d523a49b3 100644
--- a/external/zxing/StaticLibrary_zxing.mk
+++ b/external/zxing/StaticLibrary_zxing.mk
@@ -33,9 +33,6 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,zxing,\
        UnpackedTarball/zxing/core/src/aztec/AZToken \
        UnpackedTarball/zxing/core/src/aztec/AZWriter \
        UnpackedTarball/zxing/core/src/BarcodeFormat \
-       UnpackedTarball/zxing/core/src/textcodec/Big5MapTable \
-       UnpackedTarball/zxing/core/src/textcodec/Big5TextDecoder \
-       UnpackedTarball/zxing/core/src/textcodec/Big5TextEncoder \
        UnpackedTarball/zxing/core/src/BinaryBitmap \
        UnpackedTarball/zxing/core/src/BitArray \
        UnpackedTarball/zxing/core/src/BitMatrix \
@@ -45,7 +42,6 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,zxing,\
        UnpackedTarball/zxing/core/src/ConcentricFinder \
        UnpackedTarball/zxing/core/src/Content \
        UnpackedTarball/zxing/core/src/DecodeHints \
-       UnpackedTarball/zxing/core/src/DecodeStatus \
        UnpackedTarball/zxing/core/src/datamatrix/DMBitLayout \
        UnpackedTarball/zxing/core/src/datamatrix/DMDataBlock \
        UnpackedTarball/zxing/core/src/datamatrix/DMDecoder \
@@ -57,20 +53,12 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,zxing,\
        UnpackedTarball/zxing/core/src/datamatrix/DMVersion \
        UnpackedTarball/zxing/core/src/datamatrix/DMWriter \
        UnpackedTarball/zxing/core/src/ECI \
-       UnpackedTarball/zxing/core/src/textcodec/GBTextEncoder \
-       UnpackedTarball/zxing/core/src/textcodec/GBTextDecoder \
        UnpackedTarball/zxing/core/src/GenericGF \
        UnpackedTarball/zxing/core/src/GenericGFPoly \
        UnpackedTarball/zxing/core/src/GlobalHistogramBinarizer \
        UnpackedTarball/zxing/core/src/GridSampler \
-       UnpackedTarball/zxing/core/src/GS1 \
        UnpackedTarball/zxing/core/src/GTIN \
        UnpackedTarball/zxing/core/src/HybridBinarizer \
-       UnpackedTarball/zxing/core/src/textcodec/JPTextDecoder \
-       UnpackedTarball/zxing/core/src/textcodec/JPTextEncoder \
-       UnpackedTarball/zxing/core/src/textcodec/KRHangulMapping \
-       UnpackedTarball/zxing/core/src/textcodec/KRTextDecoder \
-       UnpackedTarball/zxing/core/src/textcodec/KRTextEncoder \
        UnpackedTarball/zxing/core/src/maxicode/MCBitMatrixParser \
        UnpackedTarball/zxing/core/src/maxicode/MCDecoder \
        UnpackedTarball/zxing/core/src/maxicode/MCReader \
@@ -136,8 +124,13 @@ $(eval $(call 
gb_StaticLibrary_add_generated_exception_objects,zxing,\
        UnpackedTarball/zxing/core/src/TextDecoder \
        UnpackedTarball/zxing/core/src/TextEncoder \
        UnpackedTarball/zxing/core/src/TextUtfEncoding \
+       UnpackedTarball/zxing/core/src/Utf \
        UnpackedTarball/zxing/core/src/WhiteRectDetector \
        UnpackedTarball/zxing/core/src/ZXBigInteger \
 ))
 
-# vim: set noet sw=4 ts=4:
\ No newline at end of file
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,zxing,\
+       UnpackedTarball/zxing/core/src/libzueci/zueci \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/zxing/UnpackedTarball_zxing.mk 
b/external/zxing/UnpackedTarball_zxing.mk
index b21909fc4fde..0a00622641ab 100644
--- a/external/zxing/UnpackedTarball_zxing.mk
+++ b/external/zxing/UnpackedTarball_zxing.mk
@@ -13,18 +13,9 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,zxing,$(ZXING_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,zxing,1))
 
-# * external/zxing/android_include.patch.0 was upstreamed at
-# <https://github.com/zxing-cpp/zxing-cpp/pull/458> "add missing #include 
<cmath> for std::abs"
-# external/zxing/missing-include.patch.0 was upstreamed on
-# <https://github.com/zxing-cpp/zxing-cpp/pull/463> "c++20: add missing 
include"
-# and 
<https://github.com/zxing-cpp/zxing-cpp/commit/dd19683d866f3510ae57a077e7651eba031f2f15>
-# "c++20: add missing include"
 $(eval $(call gb_UnpackedTarball_add_patches,zxing, \
-       external/zxing/assume.__cpp_lib_string_view.patch.0 \
-       external/zxing/android_include.patch.0 \
-       external/zxing/missing-include.patch.0 \
-       external/zxing/msvc-lambdacapture.patch.0 \
-       external/zxing/coroutine.patch.0 \
+       external/zxing/undeprecate-warning.patch.0 \
+       external/zxing/no_sanitize_ignored.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/zxing/android_include.patch.0 
b/external/zxing/android_include.patch.0
deleted file mode 100644
index 41c5113ec378..000000000000
--- a/external/zxing/android_include.patch.0
+++ /dev/null
@@ -1,10 +0,0 @@
---- core/src/pdf417/PDFEncoder.cpp     2022-12-07 14:21:15.860189207 +0900
-+++ core/src/pdf417/PDFEncoder.cpp     2022-12-07 14:21:20.856361002 +0900
-@@ -8,6 +8,7 @@
- #include "PDFEncoder.h"
- #include "PDFHighLevelEncoder.h"
- #include <array>
-+#include <cmath>
- #include <vector>
- #include <stdexcept>
- 
diff --git a/external/zxing/assume.__cpp_lib_string_view.patch.0 
b/external/zxing/assume.__cpp_lib_string_view.patch.0
deleted file mode 100644
index 24593aa56946..000000000000
--- a/external/zxing/assume.__cpp_lib_string_view.patch.0
+++ /dev/null
@@ -1,25 +0,0 @@
---- ./core/src/ByteArray.h     2022-12-05 10:05:07.330193204 +0000
-+++ ./core/src/ByteArray.h     2022-12-05 10:05:13.897892011 +0000
-@@ -11,9 +11,7 @@
- #include <string>
- #include <vector>
- 
--#ifdef __cpp_lib_string_view
- #include <string_view>
--#endif
- 
- namespace ZXing {
- 
-@@ -30,12 +28,10 @@
- 
-       void append(const ByteArray& other) { insert(end(), other.begin(), 
other.end()); }
- 
--#ifdef __cpp_lib_string_view
-       std::string_view asString(size_t pos = 0, size_t len = 
std::string_view::npos) const
-       {
-               return std::string_view(reinterpret_cast<const char*>(data()), 
size()).substr(pos, len);
-       }
--#endif
- };
- 
- inline std::string ToHex(const ByteArray& bytes)
diff --git a/external/zxing/coroutine.patch.0 b/external/zxing/coroutine.patch.0
deleted file mode 100644
index c863ff948f88..000000000000
--- a/external/zxing/coroutine.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- core/src/Generator.h
-+++ core/src/Generator.h
-@@ -26,7 +26,7 @@
-                       current_value = std::move(value);
-                       return {};
-               }
--//            void return_value(T&& value) noexcept { current_value = 
std::move(value); }
-+              void return_void() noexcept {}
-               // Disallow co_await in generator coroutines.
-               void await_transform() = delete;
-               [[noreturn]] static void unhandled_exception() { throw; }
diff --git a/external/zxing/inc/pch/precompiled_zxing.hxx 
b/external/zxing/inc/pch/precompiled_zxing.hxx
index 76d0c84fff13..5874187192ac 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 2021-11-03 15:03:28 using:
+ Generated on 2023-02-24 12:48:45 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:
@@ -31,12 +31,10 @@
 #include <cstdint>
 #include <cstdlib>
 #include <cstring>
-#include <cwctype>
 #include <fstream>
 #include <functional>
 #include <initializer_list>
 #include <iomanip>
-#include <iostream>
 #include <iterator>
 #include <limits>
 #include <list>
@@ -48,7 +46,6 @@
 #include <sstream>
 #include <stdexcept>
 #include <string>
-#include <type_traits>
 #include <unordered_set>
 #include <utility>
 #include <vector>
@@ -60,6 +57,7 @@
 #include <aztec/AZWriter.h>
 #include <datamatrix/DMReader.h>
 #include <datamatrix/DMWriter.h>
+#include <libzueci/zueci.h>
 #include <maxicode/MCReader.h>
 #include <oned/ODCodabarWriter.h>
 #include <oned/ODCode128Writer.h>
@@ -76,14 +74,6 @@
 #include <qrcode/QRErrorCorrectionLevel.h>
 #include <qrcode/QRReader.h>
 #include <qrcode/QRWriter.h>
-#include <textcodec/Big5TextDecoder.h>
-#include <textcodec/Big5TextEncoder.h>
-#include <textcodec/GBTextDecoder.h>
-#include <textcodec/GBTextEncoder.h>
-#include <textcodec/JPTextDecoder.h>
-#include <textcodec/JPTextEncoder.h>
-#include <textcodec/KRTextDecoder.h>
-#include <textcodec/KRTextEncoder.h>
 #endif // PCH_LEVEL >= 3
 #if PCH_LEVEL >= 4
 #endif // PCH_LEVEL >= 4
diff --git a/external/zxing/missing-include.patch.0 
b/external/zxing/missing-include.patch.0
deleted file mode 100644
index 73bca6bdcaa1..000000000000
--- a/external/zxing/missing-include.patch.0
+++ /dev/null
@@ -1,12 +0,0 @@
---- core/src/Generator.h
-+++ core/src/Generator.h
-@@ -6,7 +6,9 @@
- #pragma once
- 
- #ifdef __cpp_impl_coroutine
-+#include <concepts>
- #include <coroutine>
-+#include <iterator>
- #include <optional>
- 
- // this code is based on 
https://en.cppreference.com/w/cpp/coroutine/coroutine_handle#Example
diff --git a/external/zxing/msvc-lambdacapture.patch.0 
b/external/zxing/msvc-lambdacapture.patch.0
deleted file mode 100644
index 390d1cc65502..000000000000
--- a/external/zxing/msvc-lambdacapture.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- core/src/qrcode/QRDetector.cpp
-+++ core/src/qrcode/QRDetector.cpp
-@@ -418,7 +418,7 @@
- 
-       auto srcQuad = Rectangle(7, 7, 0.5);
- 
--      constexpr PointI FORMAT_INFO_COORDS[] = {{0, 8}, {1, 8}, {2, 8}, {3, 
8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}, {8, 8},
-+      static constexpr PointI FORMAT_INFO_COORDS[] = {{0, 8}, {1, 8}, {2, 8}, 
{3, 8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}, {8, 8},
-                                                                               
         {8, 7}, {8, 6}, {8, 5}, {8, 4}, {8, 3}, {8, 2}, {8, 1}, {8, 0}};
- 
-       FormatInformation bestFI;
diff --git a/external/zxing/no_sanitize_ignored.patch.0 
b/external/zxing/no_sanitize_ignored.patch.0
new file mode 100644
index 000000000000..692695e50a75
--- /dev/null
+++ b/external/zxing/no_sanitize_ignored.patch.0
@@ -0,0 +1,24 @@
+--- 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
new file mode 100644
index 000000000000..c955396709bc
--- /dev/null
+++ b/external/zxing/undeprecate-warning.patch.0
@@ -0,0 +1,14 @@
+--- 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

Reply via email to