summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorTaichi Haradaguchi <20001722@ymail.ne.jp>2023-07-08 23:50:10 +0900
committerTaichi Haradaguchi <20001722@ymail.ne.jp>2023-07-11 12:44:02 +0200
commit09c6ef36f43a9c7cc594c7e2d4044fee41a96406 (patch)
tree0cd29f9092c93881a2dc233a004d70b4dd15fda4 /cui
parente339b3dea0c48aa9598a4e202b18519a494e86c1 (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>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/QrCodeGenDialog.cxx11
1 files changed, 10 insertions, 1 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