diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx index 8a25e3b364e7..c727f4cdbd02 100644 --- a/cui/source/dialogs/QrCodeGenDialog.cxx +++ b/cui/source/dialogs/QrCodeGenDialog.cxx @@ -19,6 +19,7 @@ #include #if ENABLE_ZXING +#include #include #ifdef __GNUC__ @@ -38,9 +39,7 @@ #include #endif -#if __has_include() -#include -#else +#if ZXING_VERSION_MAJOR < 2 #include #endif @@ -153,8 +152,8 @@ 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() - ZXing::BitMatrix bitmatrix = writer.encode(ZXing::FromUtf8(QRText), 0, 0); +#if ZXING_VERSION_MAJOR >= 2 + ZXing::BitMatrix bitmatrix = writer.encode(QRText, 0, 0); #else ZXing::BitMatrix bitmatrix = writer.encode(ZXing::TextUtfEncoding::FromUtf8(QRText), 0, 0); #endif