<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Fix build failure with poppler &gt;= 24.03.0:

error: cannot initialize a variable of type 'int' with an rvalue of type 'Function::Type'
error: invalid operands to binary expression ('Function::Type' and 'int')

https://gitlab.com/inkscape/inkscape/-/issues/4787
https://gitlab.com/inkscape/inkscape/-/merge_requests/6209
--- src/extension/internal/pdfinput/svg-builder.cpp.orig	2023-07-16 09:32:51.000000000 -0500
+++ src/extension/internal/pdfinput/svg-builder.cpp	2024-03-06 11:14:51.000000000 -0600
@@ -1158,9 +1158,13 @@
 #define INT_EPSILON 8
 bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
                                    _POPPLER_CONST Function *func) {
-    int type = func-&gt;getType();
+    auto type = func-&gt;getType();
     auto space = shading-&gt;getColorSpace();
+#if POPPLER_CHECK_VERSION(24, 3, 0)
+    if ( type == Function::Type::Sampled || type == Function::Type::Exponential ) {  // Sampled or exponential function
+#else
     if ( type == 0 || type == 2 ) {  // Sampled or exponential function
+#endif
         GfxColor stop1, stop2;
         if (!svgGetShadingColor(shading, 0.0, &amp;stop1) || !svgGetShadingColor(shading, 1.0, &amp;stop2)) {
             return false;
@@ -1168,7 +1172,11 @@
             _addStopToGradient(gradient, 0.0, &amp;stop1, space, 1.0);
             _addStopToGradient(gradient, 1.0, &amp;stop2, space, 1.0);
         }
+#if POPPLER_CHECK_VERSION(24, 3, 0)
+    } else if ( type == Function::Type::Stitching ) { // Stitching
+#else
     } else if ( type == 3 ) { // Stitching
+#endif
         auto stitchingFunc = static_cast&lt;_POPPLER_CONST StitchingFunction*&gt;(func);
         const double *bounds = stitchingFunc-&gt;getBounds();
         const double *encode = stitchingFunc-&gt;getEncode();
@@ -1183,7 +1191,11 @@
         for ( int i = 0 ; i &lt; num_funcs ; i++ ) {
             svgGetShadingColor(shading, bounds[i + 1], &amp;color);
             // Add stops
+#if POPPLER_CHECK_VERSION(24, 3, 0)
+            if (stitchingFunc-&gt;getFunc(i)-&gt;getType() == Function::Type::Exponential) {    // process exponential fxn
+#else
             if (stitchingFunc-&gt;getFunc(i)-&gt;getType() == 2) {    // process exponential fxn
+#endif
                 double expE = (static_cast&lt;_POPPLER_CONST ExponentialFunction*&gt;(stitchingFunc-&gt;getFunc(i)))-&gt;getE();
                 if (expE &gt; 1.0) {
                     expE = (bounds[i + 1] - bounds[i])/expE;    // approximate exponential as a single straight line at x=1
</pre></body></html>