]> git.pld-linux.org Git - packages/libreoffice.git/blob - zxing1.4.patch
upstream fix for zxing >= 1.4.0 compatibility
[packages/libreoffice.git] / zxing1.4.patch
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
8
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.
12
13 See https://github.com/zxing-cpp/zxing-cpp/issues/361
14
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(-)
24
25 (limited to 'cui/source/dialogs/QrCodeGenDialog.cxx')
26
27 diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx
28 index f8cbac1d758d..817be7f21ede 100644
29 --- a/cui/source/dialogs/QrCodeGenDialog.cxx
30 +++ b/cui/source/dialogs/QrCodeGenDialog.cxx
31 @@ -27,7 +27,6 @@
32  #endif
33  
34  #include <BarcodeFormat.h>
35 -#include <BitArray.h>
36  #include <BitMatrix.h>
37  #include <MultiFormatWriter.h>
38  #include <TextUtfEncoding.h>
39 @@ -79,7 +78,6 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
40      OStringBuffer sb;
41      const int width = bitmatrix.width();
42      const int height = bitmatrix.height();
43 -    ZXing::BitArray row(width);
44      sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
45                "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 "
46                + OString::number(width) + " " + OString::number(height)
47 @@ -87,10 +85,9 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
48                  "<path d=\"");
49      for (int i = 0; i < height; ++i)
50      {
51 -        bitmatrix.getRow(i, row);
52          for (int j = 0; j < width; ++j)
53          {
54 -            if (row.get(j))
55 +            if (bitmatrix.get(j, i))
56              {
57                  sb.append("M" + OString::number(j) + "," + OString::number(i) + "h1v1h-1z");
58              }
59 -- 
60 cgit v1.2.1
61
This page took 0.037334 seconds and 4 git commands to generate.