archrelease: copy trunk to extra-x86_64
[arch-packages.git] / libreoffice-still / repos / extra-x86_64 / 0001_Remove_dependency_on_BitArray.h_from_zxing-1.2.0.patch
blob52b383a9d3e9aaba4f04465aefc9421096c0e4ab
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
5 MIME-Version: 1.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>
19 Tested-by: Jenkins
20 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
21 ---
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
29 @@ -27,7 +27,6 @@
30 #endif
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)
38 OStringBuffer sb;
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)
46 "<path d=\"");
47 for (int i = 0; i < height; ++i)
49 - bitmatrix.getRow(i, row);
50 for (int j = 0; j < width; ++j)
52 - if (row.get(j))
53 + if (bitmatrix.get(j, i))
55 sb.append("M" + OString::number(j) + "," + OString::number(i) + "h1v1h-1z");
57 --
58 cgit v1.2.1