summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-05-31 02:01:56 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-05-31 13:16:19 +0200
commitaf281d5bc2fb3f2c31f1718b711b32213a12219c (patch)
treedb67ff77a5fd793fbd37e21827132523a54679e4 /cui
parente8bba8229080f873b89b39551e924d1c8609fc07 (diff)
no-zxing: Unused GenerateQRCode function
... and while at it fix (new?) [loplugin:stringviewparam]. Change-Id: I4b991e58040df8082e141ba3c7a0d1968871d517 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116436 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/QrCodeGenDialog.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx
index 9e4d1df1d96d..9a42e4ddc057 100644
--- a/cui/source/dialogs/QrCodeGenDialog.cxx
+++ b/cui/source/dialogs/QrCodeGenDialog.cxx
@@ -98,11 +98,9 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
sb.append("\"/>\n</svg>");
return sb.toString();
}
-#endif
-OString GenerateQRCode(const OUString& aQRText, tools::Long aQRECC, int aQRBorder)
+OString GenerateQRCode(std::u16string_view aQRText, tools::Long aQRECC, int aQRBorder)
{
-#if ENABLE_ZXING
// Associated ZXing error correction levels (0-8) to our constants arbitrarily.
int bqrEcc = 1;
@@ -137,14 +135,10 @@ OString GenerateQRCode(const OUString& aQRText, tools::Long aQRECC, int aQRBorde
writer.setEncoding(ZXing::CharacterSet::UTF8);
ZXing::BitMatrix bitmatrix = writer.encode(ZXing::TextUtfEncoding::FromUtf8(QRText), 0, 0);
return ConvertToSVGFormat(bitmatrix);
-#else
- (void)aQRText;
- (void)aQRECC;
- (void)aQRBorder;
- return OString();
-#endif
-}
}
+#endif
+
+} // anonymous namespace
QrCodeGenDialog::QrCodeGenDialog(weld::Widget* pParent, Reference<XModel> xModel,
bool bEditExisting)