summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-21 17:02:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-21 21:39:27 +0200
commita2791a8b0de05cec8a94b5bd19a6ff6ee4fd76c5 (patch)
tree1c298b553eb1936c2c05554623464eda8ced8d06 /cui/source/dialogs
parentc4cd874c4ea7140e03fbcd2d853a5b8b680afaad (diff)
add an explicit --disable-qrcodegen configure option
Change-Id: If8e965fa955aecdb9e7011bdddc690de9cad0c4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103120 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/QrCodeGenDialog.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx
index 85ed9309df9c..bc56c2ddf4e1 100644
--- a/cui/source/dialogs/QrCodeGenDialog.cxx
+++ b/cui/source/dialogs/QrCodeGenDialog.cxx
@@ -17,11 +17,15 @@
#include <utility>
#include <vcl/svapp.hxx>
+#include <config_qrcodegen.h>
+
+#if ENABLE_QRCODEGEN
#if defined(SYSTEM_QRCODEGEN)
#include <qrcodegen/QrCode.hpp>
#else
#include <QrCode.hpp>
#endif
+#endif
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -56,7 +60,9 @@ using namespace css::sheet;
using namespace css::text;
using namespace css::drawing;
using namespace css::graphic;
+#if ENABLE_QRCODEGEN
using namespace qrcodegen;
+#endif
QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel,
bool bEditExisting)
@@ -104,6 +110,7 @@ QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel
short QrCodeGenDialog::run()
{
+#if ENABLE_QRCODEGEN
short nRet;
while (true)
{
@@ -127,10 +134,14 @@ short QrCodeGenDialog::run()
break;
}
return nRet;
+#else
+ return RET_CANCEL;
+#endif
}
void QrCodeGenDialog::Apply()
{
+#if ENABLE_QRCODEGEN
css::drawing::QRCode aQRCode;
aQRCode.Payload = m_xEdittext->get_text();
@@ -250,13 +261,12 @@ void QrCodeGenDialog::Apply()
//Not implemented for math,base and other apps.
throw uno::RuntimeException("Not implemented");
}
+#endif
}
OUString QrCodeGenDialog::GenerateQRCode(OUString aQRText, long aQRECC, int aQRBorder)
{
-#if ENABLE_FUZZERS
- return OUString();
-#else
+#if ENABLE_QRCODEGEN
//Select ECC:: value from aQrECC
qrcodegen::QrCode::Ecc bqrEcc = qrcodegen::QrCode::Ecc::LOW;
@@ -293,6 +303,11 @@ OUString QrCodeGenDialog::GenerateQRCode(OUString aQRText, long aQRECC, int aQRB
std::string svg = qr0.toSvgString(aQRBorder);
//cstring to OUString
return OUString::createFromAscii(svg.c_str());
+#else
+ (void)aQRText;
+ (void)aQRECC;
+ (void)aQRBorder;
+ return OUString();
#endif
}