[packages/libreoffice] upstream fix for zxing >= 1.4.0 compatibility

atler atler at pld-linux.org
Sun Feb 19 20:58:37 CET 2023


commit 9ff160c7ad91042603916951667c0e18be768789
Author: Jan Palus <atler at pld-linux.org>
Date:   Sun Feb 19 20:57:55 2023 +0100

    upstream fix for zxing >= 1.4.0 compatibility

 libreoffice.spec |  2 ++
 zxing1.4.patch   | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
---
diff --git a/libreoffice.spec b/libreoffice.spec
index 81d6c7c..f9b3d63 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -111,6 +111,7 @@ Patch1:		pld-skia-patches.patch
 Patch2:		%{name}-poppler.patch
 Patch3:		boost1.81.patch
 Patch4:		gpgme1.18.patch
+Patch5:		zxing1.4.patch
 URL:		https://www.documentfoundation.org/
 BuildRequires:	/usr/bin/getopt
 %{?with_firebird:BuildRequires:	Firebird-devel >= 3.0.0.0}
@@ -2896,6 +2897,7 @@ oraz narzędzie ui-previewer do sprawdzania wyglądu okien dialogowych.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 for dir in *-%{version}; do
 	[ -f $dir/ChangeLog ] && %{__mv} $dir/ChangeLog ChangeLog-$dir
diff --git a/zxing1.4.patch b/zxing1.4.patch
new file mode 100644
index 0000000..505d54a
--- /dev/null
+++ b/zxing1.4.patch
@@ -0,0 +1,61 @@
+From 15e5d86cc55ad94ac946e04d5e25b84be5810970 Mon Sep 17 00:00:00 2001
+From: "Brett T. Warden" <brett.t.warden at intel.com>
+Date: Fri, 30 Dec 2022 08:43:25 +0100
+Subject: Remove dependency on BitArray.h from zxing-1.2.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In zxing-1.4.0, numerous headers are no longer public. Rework the
+ConvertToSVGFormat method so it uses bitmatrix.get instead of
+bitmatrix.getRow, similar to the ToSVG method in zxing itself.
+
+See https://github.com/zxing-cpp/zxing-cpp/issues/361
+
+Change-Id: Ie25eb8f782e8799fbd57c24ef79bba92acf0f9ff
+Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144874
+Tested-by: René Engelhard <rene at debian.org>
+Reviewed-by: René Engelhard <rene at debian.org>
+Tested-by: Jenkins
+Reviewed-by: Caolán McNamara <caolanm at redhat.com>
+---
+ cui/source/dialogs/QrCodeGenDialog.cxx | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+(limited to 'cui/source/dialogs/QrCodeGenDialog.cxx')
+
+diff --git a/cui/source/dialogs/QrCodeGenDialog.cxx b/cui/source/dialogs/QrCodeGenDialog.cxx
+index f8cbac1d758d..817be7f21ede 100644
+--- a/cui/source/dialogs/QrCodeGenDialog.cxx
++++ b/cui/source/dialogs/QrCodeGenDialog.cxx
+@@ -27,7 +27,6 @@
+ #endif
+ 
+ #include <BarcodeFormat.h>
+-#include <BitArray.h>
+ #include <BitMatrix.h>
+ #include <MultiFormatWriter.h>
+ #include <TextUtfEncoding.h>
+@@ -79,7 +78,6 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
+     OStringBuffer sb;
+     const int width = bitmatrix.width();
+     const int height = bitmatrix.height();
+-    ZXing::BitArray row(width);
+     sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+               "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 "
+               + OString::number(width) + " " + OString::number(height)
+@@ -87,10 +85,9 @@ OString ConvertToSVGFormat(const ZXing::BitMatrix& bitmatrix)
+                 "<path d=\"");
+     for (int i = 0; i < height; ++i)
+     {
+-        bitmatrix.getRow(i, row);
+         for (int j = 0; j < width; ++j)
+         {
+-            if (row.get(j))
++            if (bitmatrix.get(j, i))
+             {
+                 sb.append("M" + OString::number(j) + "," + OString::number(i) + "h1v1h-1z");
+             }
+-- 
+cgit v1.2.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libreoffice.git/commitdiff/9ff160c7ad91042603916951667c0e18be768789



More information about the pld-cvs-commit mailing list