1 From 15e5d86cc55ad94ac946e04d5e25b84be5810970 Mon Sep 17 00:00:00 2001
2 From: "Brett T. Warden" <brett.t.warden@intel.com>
3 Date: Fri, 30 Dec 2022 08:43:25 +0100
4 Subject: Remove dependency on BitArray.h from zxing-1.2.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 In zxing-1.4.0, numerous headers are no longer public. Rework the
10 ConvertToSVGFormat method so it uses bitmatrix.get instead of
11 bitmatrix.getRow, similar to the ToSVG method in zxing itself.
13 See https://github.com/zxing-cpp/zxing-cpp/issues/361
15 Change-Id: Ie25eb8f782e8799fbd57c24ef79bba92acf0f9ff
16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144874
17 Tested-by: René Engelhard <rene@debian.org>
18 Reviewed-by: René Engelhard <rene@debian.org>
20 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
22 cui/source/dialogs/QrCodeGenDialog.cxx | 5 +----
23 1 file changed, 1 insertion(+), 4 deletions(-)
25 diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx
26 index f8cbac1d758d..817be7f21ede 100644
27 --- a/cui/source/dialogs/QrCodeGenDialog.cxx
28 +++ b/cui/source/dialogs/QrCodeGenDialog.cxx
32 #include <BarcodeFormat.h>
33 -#include <BitArray.h>
34 #include <BitMatrix.h>
35 #include <MultiFormatWriter.h>
36 #include <TextUtfEncoding.h>
37 @@ -79,7 +78,6 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
39 const int width = bitmatrix.width();
40 const int height = bitmatrix.height();
41 - ZXing::BitArray row(width);
42 sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
43 "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 "
44 + OString::number(width) + " " + OString::number(height)
45 @@ -87,10 +85,9 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
47 for (int i = 0; i < height; ++i)
49 - bitmatrix.getRow(i, row);
50 for (int j = 0; j < width; ++j)
53 + if (bitmatrix.get(j, i))
55 sb.append("M" + OString::number(j) + "," + OString::number(i) + "h1v1h-1z");