download.lst | 4 - external/zxing/0001-add-ZXVersion-h.patch | 29 ++++++++---- external/zxing/0001-const-up-some-symbols.patch | 54 ----------------------- external/zxing/StaticLibrary_zxing.mk | 5 +- external/zxing/UnpackedTarball_zxing.mk | 6 -- external/zxing/deprecatedMultiFormatWriter.patch | 11 ++++ external/zxing/gcc12-format.patch | 35 ++++++++++++++ external/zxing/inc/pch/precompiled_zxing.hxx | 27 ++--------- 8 files changed, 81 insertions(+), 90 deletions(-)
New commits: commit 3b43b3164f5edce7ab69825639cd5b0fb300daa3 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Feb 11 14:04:41 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed Feb 11 16:49:12 2026 +0100 zxing-cpp: Upgrade to 3.0.0 * 0001-const-up-some-symbols.patch has been fixed upstream * Add gcc12-format.patch to fix 'fatal error: 'format' file not found #include <format>' * Add deprecatedMultiFormatWriter.patch to fix cui/source/dialogs/QrCodeGenDialog.cxx:158:50: error: ‘ZXing::MultiFormatWriter::MultiFormatWriter(ZXing::BarcodeFormat)’ is deprecated: use CreateBarcode() [-Werror=deprecated-declarations] 158 | auto writer = ZXing::MultiFormatWriter(format).setMargin(aQRBorder).setEccLevel(bqrEcc); TODO: fix the deprecated warning Downloaded from https://github.com/zxing-cpp/zxing-cpp/releases/download/v3.0.0/zxing-cpp-3.0.0.tar.gz Change-Id: Icff1a67b4c0441ded4a87212763a998f2889e264 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199178 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/download.lst b/download.lst index f05fdd2d853b..857dff1c4b81 100644 --- a/download.lst +++ b/download.lst @@ -726,8 +726,8 @@ ZXCVBN_C_TARBALL := zxcvbn-c-2.6.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -ZXING_SHA256SUM := 64e4139103fdbc57752698ee15b5f0b0f7af9a0331ecbdc492047e0772c417ba -ZXING_TARBALL := zxing-cpp-2.3.0.tar.gz +ZXING_SHA256SUM := bfea8f8ebc8e04e5c4a57e5cbdc302d05c72b916d142564b6d14f01050bb93d4 +ZXING_TARBALL := zxing-cpp-3.0.0.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/zxing/0001-add-ZXVersion-h.patch b/external/zxing/0001-add-ZXVersion-h.patch index 8dc13af3d5a4..f1f039d4d108 100644 --- a/external/zxing/0001-add-ZXVersion-h.patch +++ b/external/zxing/0001-add-ZXVersion-h.patch @@ -1,6 +1,8 @@ +# Generated with 'cmake -DZXING_WRITERS=OLD' + --- /dev/null 2023-12-10 14:00:18.140142051 +0100 +++ a/core/src/Version.h 2023-12-22 21:38:22.466302568 +0100 -@@ -0,0 +1,18 @@ +@@ -0,0 +1,28 @@ +/* +* Copyright 2019 Nu-book Inc. +* Copyright 2023 Axel Waggershauser @@ -9,13 +11,24 @@ + +#pragma once + -+// Version numbering -+#define ZXING_VERSION_MAJOR 2 -+#define ZXING_VERSION_MINOR 3 -+#define ZXING_VERSION_PATCH 0 ++#define ZXING_READERS ++#define ZXING_WRITERS ++ ++#define ZXING_ENABLE_1D 1 ++#define ZXING_ENABLE_AZTEC 1 ++#define ZXING_ENABLE_DATAMATRIX 1 ++#define ZXING_ENABLE_MAXICODE 1 ++#define ZXING_ENABLE_PDF417 1 ++#define ZXING_ENABLE_QRCODE 1 + -+namespace ZXing { ++/* #undef ZXING_EXPERIMENTAL_API */ ++/* #undef ZXING_USE_ZINT */ + -+constexpr const char* ZXING_VERSION_STR = "2.3.0"; ++// Version numbering ++#define ZXING_VERSION_MAJOR 3 ++#define ZXING_VERSION_MINOR 0 ++#define ZXING_VERSION_PATCH 0 ++#define ZXING_VERSION_SUFFIX "" + -+} ++#define ZXING_VERSION_STR "3.0.0" + diff --git a/external/zxing/0001-const-up-some-symbols.patch b/external/zxing/0001-const-up-some-symbols.patch deleted file mode 100644 index d031a1c06ac3..000000000000 --- a/external/zxing/0001-const-up-some-symbols.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 62417799d3c46ea52a2e2feba4f97566c50de96c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> -Date: Sun, 20 Jul 2025 20:56:39 +0100 -Subject: [PATCH] const up some symbols - -and move them out of the .data section ---- - core/src/BarcodeFormat.cpp | 2 +- - core/src/datamatrix/DMSymbolInfo.cpp | 2 +- - core/src/pdf417/PDFEncoder.cpp | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/core/src/BarcodeFormat.cpp b/core/src/BarcodeFormat.cpp -index ba9a2937..9be60850 100644 ---- a/core/src/BarcodeFormat.cpp -+++ b/core/src/BarcodeFormat.cpp -@@ -22,7 +22,7 @@ struct BarcodeFormatName - std::string_view name; - }; - --static BarcodeFormatName NAMES[] = { -+static const BarcodeFormatName NAMES[] = { - {BarcodeFormat::None, "None"}, - {BarcodeFormat::Aztec, "Aztec"}, - {BarcodeFormat::Codabar, "Codabar"}, -diff --git a/core/src/datamatrix/DMSymbolInfo.cpp b/core/src/datamatrix/DMSymbolInfo.cpp -index 9247dd26..fee1b235 100644 ---- a/core/src/datamatrix/DMSymbolInfo.cpp -+++ b/core/src/datamatrix/DMSymbolInfo.cpp -@@ -50,7 +50,7 @@ static constexpr const SymbolInfo PROD_SYMBOLS[] = { - { false, 1558, 620, 22, 22, 36, -1, 62 }, - }; - --static const SymbolInfo* s_symbols = PROD_SYMBOLS; -+static const SymbolInfo* const s_symbols = PROD_SYMBOLS; - static ZXING_IF_NOT_TEST(const) size_t s_symbolCount = Size(PROD_SYMBOLS); - - #ifdef ZXING_BUILD_FOR_TEST -diff --git a/core/src/pdf417/PDFEncoder.cpp b/core/src/pdf417/PDFEncoder.cpp -index a5b884e4..a5dd3ab4 100644 ---- a/core/src/pdf417/PDFEncoder.cpp -+++ b/core/src/pdf417/PDFEncoder.cpp -@@ -286,7 +286,7 @@ static const short EC_COEFFICIENTS_L8[] = { 352, 77, 373, 504, 35, 599, 428, 2 - 407, 164, 332, 899, 165, 726, 600, 325, 498, 655, 357, 752, 768, 223, 849, 647, - 63, 310, 863, 251, 366, 304, 282, 738, 675, 410, 389, 244, 31, 121, 303, 263, }; - --static const short* EC_COEFFICIENTS[] = {EC_COEFFICIENTS_L0, EC_COEFFICIENTS_L1, EC_COEFFICIENTS_L2, -+static const short* const EC_COEFFICIENTS[] = {EC_COEFFICIENTS_L0, EC_COEFFICIENTS_L1, EC_COEFFICIENTS_L2, - EC_COEFFICIENTS_L3, EC_COEFFICIENTS_L4, EC_COEFFICIENTS_L5, - EC_COEFFICIENTS_L6, EC_COEFFICIENTS_L7, EC_COEFFICIENTS_L8}; - --- -2.49.0 - diff --git a/external/zxing/StaticLibrary_zxing.mk b/external/zxing/StaticLibrary_zxing.mk index 44eb0de84194..dedf447adca3 100644 --- a/external/zxing/StaticLibrary_zxing.mk +++ b/external/zxing/StaticLibrary_zxing.mk @@ -24,6 +24,10 @@ $(eval $(call gb_StaticLibrary_set_include,zxing,\ $$(INCLUDE) \ )) +$(eval $(call gb_StaticLibrary_add_cxxflags,zxing,\ + -DZXING_INTERNAL \ +)) + # The list below is created with # find workdir/UnpackedTarball/zxing/core/ -name "*.cpp" ! -name '*DecodeHints.cpp' | LC_COLLATE=C sort | sed -e 's/^/ /' -e 's/$/ \/' -e 's/workdir\///' -e 's/\.cpp//' $(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\ @@ -55,7 +59,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\ UnpackedTarball/zxing/core/src/ResultPoint \ 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/WriteBarcode \ diff --git a/external/zxing/UnpackedTarball_zxing.mk b/external/zxing/UnpackedTarball_zxing.mk index 5c0b6a799d43..4f1863536e08 100644 --- a/external/zxing/UnpackedTarball_zxing.mk +++ b/external/zxing/UnpackedTarball_zxing.mk @@ -11,9 +11,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,zxing)) $(eval $(call gb_UnpackedTarball_set_tarball,zxing,$(ZXING_TARBALL))) -# external/zxing/0001-const-up-some-symbols.patch -# upstream effort at: https://github.com/zxing-cpp/zxing-cpp/pull/979 - ifneq ($(MSYSTEM),) # the 2.3.0 tarball contains dangling symlinks (to a submodule component/experimental backend) # git-bash/msys tar fails when extracting since MSYS defaults to not create those @@ -24,7 +21,8 @@ endif $(eval $(call gb_UnpackedTarball_add_patches,zxing, \ external/zxing/0001-add-ZXVersion-h.patch \ - external/zxing/0001-const-up-some-symbols.patch \ + external/zxing/gcc12-format.patch \ + external/zxing/deprecatedMultiFormatWriter.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/zxing/deprecatedMultiFormatWriter.patch b/external/zxing/deprecatedMultiFormatWriter.patch new file mode 100644 index 000000000000..a9750068bff3 --- /dev/null +++ b/external/zxing/deprecatedMultiFormatWriter.patch @@ -0,0 +1,11 @@ +--- zxing/core/src/MultiFormatWriter.h 2026-02-11 13:06:00.665958666 +0100 ++++ zxing/core/src/MultiFormatWriter.h 2026-02-11 13:06:08.693923744 +0100 +@@ -23,7 +23,7 @@ + class MultiFormatWriter + { + public: +- [[deprecated("use CreateBarcode()")]] explicit MultiFormatWriter(BarcodeFormat format) : _format(format) {} ++ explicit MultiFormatWriter(BarcodeFormat format) : _format(format) {} + + /** + * Used for Aztec, PDF417, and QRCode only. diff --git a/external/zxing/gcc12-format.patch b/external/zxing/gcc12-format.patch new file mode 100644 index 000000000000..dd731cfc821d --- /dev/null +++ b/external/zxing/gcc12-format.patch @@ -0,0 +1,35 @@ +--- /dev/null 2023-12-10 14:00:18.140142051 +0100 ++++ a/core/src/Version.h 2023-12-22 21:38:22.466302568 +0100 +--- zxing/core/src/BarcodeFormat.cpp 2026-02-11 12:34:03.089993797 +0100 ++++ zxing/core/src/BarcodeFormat.cpp 2026-02-11 12:34:12.849941196 +0100 +@@ -9,7 +9,6 @@ + #include "ZXAlgorithms.h" + + #include <algorithm> +-#include <format> + + namespace ZXing { + +--- zxing/core/src/GTIN.cpp 2026-02-11 12:36:55.685059936 +0100 ++++ zxing/core/src/GTIN.cpp 2026-02-11 12:38:19.324604946 +0100 +@@ -7,7 +7,6 @@ + #include "GTIN.h" + + #include <algorithm> +-#include <format> + #include <iomanip> + #include <iterator> + #include <string> +@@ -241,11 +240,7 @@ + } + + int rawAmount = std::stoi(ean5AddOn.substr(1)); +-#ifndef __cpp_lib_to_chars // not available on older macOS + return currency + std::to_string(rawAmount / 100) + '.' + std::to_string(rawAmount % 100); +-#else +- return std::format("{}{:.2f}", currency, float(rawAmount) / 100); +-#endif + } + + } // namespace ZXing::GTIN + diff --git a/external/zxing/inc/pch/precompiled_zxing.hxx b/external/zxing/inc/pch/precompiled_zxing.hxx index 4ab1b7042889..fb3e614767eb 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 2025-01-02 12:16:27 using: + Generated on 2026-02-11 13:08:20 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: @@ -24,12 +24,15 @@ #if PCH_LEVEL >= 1 #include <algorithm> #include <array> +#include <bit> #include <cassert> #include <cctype> +#include <charconv> #include <climits> #include <cmath> #include <cstddef> #include <cstdint> +#include <cstdio> #include <cstdlib> #include <cstring> #include <exception> @@ -42,8 +45,10 @@ #include <map> #include <memory> #include <mutex> +#include <numbers> #include <numeric> #include <optional> +#include <ranges> #include <sstream> #include <stdexcept> #include <string> @@ -55,27 +60,7 @@ #if PCH_LEVEL >= 2 #endif // PCH_LEVEL >= 2 #if PCH_LEVEL >= 3 -#include <aztec/AZReader.h> -#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> -#include <oned/ODCode39Writer.h> -#include <oned/ODCode93Writer.h> -#include <oned/ODEAN13Writer.h> -#include <oned/ODEAN8Writer.h> -#include <oned/ODITFWriter.h> -#include <oned/ODReader.h> -#include <oned/ODUPCAWriter.h> -#include <oned/ODUPCEWriter.h> -#include <pdf417/PDFReader.h> -#include <pdf417/PDFWriter.h> -#include <qrcode/QRErrorCorrectionLevel.h> -#include <qrcode/QRReader.h> -#include <qrcode/QRWriter.h> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 #endif // PCH_LEVEL >= 4
