[Libreoffice-commits] core.git: cui/source

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Mon May 31 11:17:00 UTC 2021


 cui/source/dialogs/QrCodeGenDialog.cxx |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit af281d5bc2fb3f2c31f1718b711b32213a12219c
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon May 31 02:01:56 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Mon May 31 13:16:19 2021 +0200

    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 at fbihome.de>

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)


More information about the Libreoffice-commits mailing list