pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/inkscape Adapt to new poppler API



details:   https://anonhg.NetBSD.org/pkgsrc/rev/386b7dcae494
branches:  trunk
changeset: 384699:386b7dcae494
user:      martin <martin%pkgsrc.org@localhost>
date:      Sun Sep 04 07:55:02 2022 +0000

description:
Adapt to new poppler API

diffstat:

 graphics/inkscape/distinfo                                                      |   4 +-
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp  |  29 ++++++++++
 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp |  26 ++++++++
 3 files changed, 58 insertions(+), 1 deletions(-)

diffs (78 lines):

diff -r 9191ed910aef -r 386b7dcae494 graphics/inkscape/distinfo
--- a/graphics/inkscape/distinfo        Sun Sep 04 06:58:57 2022 +0000
+++ b/graphics/inkscape/distinfo        Sun Sep 04 07:55:02 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.91 2022/08/02 07:31:05 wiz Exp $
+$NetBSD: distinfo,v 1.92 2022/09/04 07:55:02 martin Exp $
 
 BLAKE2s (inkscape-1.2.1.tar.xz) = d044b582e20c274f04fb1f3fd8392d0e42798aa7aed284ad81d263cfa4d3926a
 SHA512 (inkscape-1.2.1.tar.xz) = 1f968cb20855e77ad8a1b16f8d4841e3279e139c7b1f41eccb7fbef9a7da092f3ffe7f123d032c395939a002725f68d6f1305b2a87ed68610a69a31052711521
@@ -6,3 +6,5 @@
 SHA1 (patch-CMakeScripts_DefineDependsandFlags.cmake) = 26351c300629e28f6523fe2167a2eed5802435cf
 SHA1 (patch-src_actions_actions-edit.cpp) = 8f18d7889ba2d1d8e39b9ee6c87e0d3df905807d
 SHA1 (patch-src_extension_implementation_script.cpp) = da46549f688da5c9c0ecbeaeac7962e4f261cae4
+SHA1 (patch-src_extension_internal_pdfinput_pdf-parser.cpp) = 45d82e49593cad9de30fc34c78ddc5836b494136
+SHA1 (patch-src_extension_internal_pdfinput_svg-builder.cpp) = 083636dee58dc862fe26a1e81c380d4c508f2382
diff -r 9191ed910aef -r 386b7dcae494 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_pdf-parser.cpp    Sun Sep 04 07:55:02 2022 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_extension_internal_pdfinput_pdf-parser.cpp,v 1.19 2022/09/04 07:55:02 martin Exp $
+
+Adapt to new poppler API
+
+--- src/extension/internal/pdfinput/pdf-parser.cpp.orig        2022-05-07 15:43:15.000000000 +0200
++++ src/extension/internal/pdfinput/pdf-parser.cpp     2022-09-04 09:43:47.958399506 +0200
+@@ -685,19 +685,18 @@ void PdfParser::opConcat(Object args[], 
+ // TODO not good that numArgs is ignored but args[] is used:
+ void PdfParser::opSetDash(Object args[], int /*numArgs*/)
+ {
+-  double *dash = nullptr;
++  std::vector<double> dash;
+ 
+   Array *a = args[0].getArray();
+   int length = a->getLength();
+   if (length != 0) {
+-    dash = (double *)gmallocn(length, sizeof(double));
+     for (int i = 0; i < length; ++i) {
+       Object obj;
+-      dash[i] = _POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum();
++      dash.push_back(_POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum());
+       _POPPLER_FREE(obj);
+     }
+   }
+-  state->setLineDash(dash, length, args[1].getNum());
++  state->setLineDash(std::move(dash), args[1].getNum());
+   builder->updateStyle(state);
+ }
+ 
diff -r 9191ed910aef -r 386b7dcae494 graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/inkscape/patches/patch-src_extension_internal_pdfinput_svg-builder.cpp   Sun Sep 04 07:55:02 2022 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_extension_internal_pdfinput_svg-builder.cpp,v 1.8 2022/09/04 07:55:02 martin Exp $
+
+Adapt to new poppler API
+
+--- src/extension/internal/pdfinput/svg-builder.cpp.orig       2022-05-07 15:43:15.000000000 +0200
++++ src/extension/internal/pdfinput/svg-builder.cpp    2022-09-04 09:46:02.599786816 +0200
+@@ -388,15 +388,13 @@ void SvgBuilder::_setStrokeStyle(SPCSSAt
+     sp_repr_css_set_property(css, "stroke-miterlimit", os_ml.str().c_str());
+ 
+     // Line dash
+-    double *dash_pattern;
+-    int dash_length;
+     double dash_start;
+-    state->getLineDash(&dash_pattern, &dash_length, &dash_start);
+-    if ( dash_length > 0 ) {
++    auto dash_pattern = state->getLineDash(&dash_start);
++    if ( !dash_pattern.empty() ) {
+         Inkscape::CSSOStringStream os_array;
+-        for ( int i = 0 ; i < dash_length ; i++ ) {
++        for ( size_t i = 0; i < dash_pattern.size(); i++ ) {
+             os_array << dash_pattern[i];
+-            if (i < (dash_length - 1)) {
++            if (i < (dash_pattern.size() - 1)) {
+                 os_array << ",";
+             }
+         }



Home | Main Index | Thread Index | Old Index