Hi!

On Tue, Dec 13, 2022 at 11:44:49AM -0300, Nathan Pratta Teodosio wrote:
> Hi, I have observed that Scribus fails to build against Poppler 22.12.
> 
> I forward a patch that fixes that[1]. This time I double checked the
> line endings. ;)


Thank you for the patch and finding it upstream already!

…however:

> From: Nathan Pratta Teodosio <nathan.teodo...@canonical.com>
> Description: Fix build with Poppler >=22.9.0
> Origin: upstream, 
> https://www.scribus.net/websvn/revision.php?repname=Scribus&rev=25139
> git-svn-id: svn://scribus.net/trunk/Scribus@25140 
> 11d20701-8431-0410-a711-e3c959e3b870

Note that 25139 is the right one, but the git-svn-id mentions 25140
(that's the same commit applied on the trunk, which is mostly the same
sure).

But that's not what I'm concerned about:

> --- a/scribus/plugins/import/pdf/slaoutput.cpp
> +++ b/scribus/plugins/import/pdf/slaoutput.cpp
> @@ -3628,16 +3628,11 @@ void SlaOutputDev::getPenState(GfxState *state)
>                       m_lineJoin = Qt::BevelJoin;
>                       break;
>       }
> -     double lw = state->getLineWidth();
> -     double *dashPattern;
> -     int dashLength;
> -     state->getLineDash(&dashPattern, &dashLength, &DashOffset);
> -     QVector<double> pattern(dashLength);
> -     for (int i = 0; i < dashLength; ++i)
> -     {
> -             pattern[i] = dashPattern[i] / lw;
> -     }
> -     DashValues = pattern;
> +     const auto& dashPattern = state->getLineDash(&DashOffset);
> +     QVector<double> pattern(dashPattern.size());
> +     for (size_t i = 0; i < dashPattern.size(); ++i)
> +             pattern[i] = dashPattern[i];
> +     DashValues = pattern;

This is not the same patch coming from upstream!?
Upstream added some #if guards to compile both with poppler>= 22.9 and
with older versions as well.  I haven't checked if the 22.9 variant also
works with older poppler versions (perhaps it does, even), but I don't
understand why you would rewrite this part of the patch, even more
without mentioning it in the patch description?…

For reference:

mattia@warren ..el/debian/scribus/others/upstream/v15x (svn)-[Scribus:25225] % 
svn diff -c 25139
Index: scribus/plugins/import/pdf/slaoutput.cpp
===================================================================
--- scribus/plugins/import/pdf/slaoutput.cpp    (revision 25138)
+++ scribus/plugins/import/pdf/slaoutput.cpp    (revision 25139)
@@ -3756,6 +3756,13 @@
                        m_lineJoin = Qt::BevelJoin;
                        break;
        }
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 9, 0)
+       const auto& dashPattern = state->getLineDash(&m_dashOffset);
+       QVector<double> pattern(dashPattern.size());
+       for (size_t i = 0; i < dashPattern.size(); ++i)
+               pattern[i] = dashPattern[i];
+       m_dashValues = pattern;
+#else
        double *dashPattern;
        int dashLength;
        state->getLineDash(&dashPattern, &dashLength, &m_dashOffset);
@@ -3763,6 +3770,7 @@
        for (int i = 0; i < dashLength; ++i)
                pattern[i] = dashPattern[i];
        m_dashValues = pattern;
+#endif
 }

 int SlaOutputDev::getBlendMode(GfxState *state)


-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
More about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

Attachment: signature.asc
Description: PGP signature

Reply via email to