summaryrefslogtreecommitdiff
path: root/app-office/scribus/files/scribus-1.6.1-poppler-24.03.patch
blob: 076e48e14fd90e3f06cf50799e252e114ae56e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From dc2470990ab73c87fdd60068c99518ced01a3edd Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Mon, 4 Mar 2024 17:35:11 +0100
Subject: [PATCH] Fix build with >=poppler-24.03.0

Fixes build errors caused by:

"Use an enum for Function getType"
Upstream commit 6e3824d45d42cb806a28a2df84e4ab6bb3587083

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 scribus/plugins/import/pdf/slaoutput.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
index 4e31e4b6c..3e4a768ec 100644
--- a/scribus/plugins/import/pdf/slaoutput.cpp
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
@@ -1731,7 +1731,11 @@ bool SlaOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, do
 	VGradient FillGradient = VGradient(VGradient::linear);
 	FillGradient.clearStops();
 	GfxColorSpace *color_space = shading->getColorSpace();
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 3, 0)
+	if (func->getType() == Function::Type::Stitching)
+#else
 	if (func->getType() == 3)
+#endif
 	{
 		StitchingFunction *stitchingFunc = (StitchingFunction*)func;
 		const double *bounds = stitchingFunc->getBounds();
@@ -1753,7 +1757,11 @@ bool SlaOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, do
 			FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
 		}
 	}
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 3, 0)
+	else if ((func->getType() == Function::Type::Exponential) || (func->getType() == Function::Type::Sampled))
+#else
 	else if ((func->getType() == 2) || (func->getType() == 0))
+#endif
 	{
 		GfxColor stop1;
 		shading->getColor(0.0, &stop1);
@@ -1865,7 +1873,11 @@ bool SlaOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading,
 	VGradient FillGradient = VGradient(VGradient::linear);
 	FillGradient.clearStops();
 	GfxColorSpace *color_space = shading->getColorSpace();
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 3, 0)
+	if (func->getType() == Function::Type::Stitching)
+#else
 	if (func->getType() == 3)
+#endif
 	{
 		StitchingFunction *stitchingFunc = (StitchingFunction*)func;
 		const double *bounds = stitchingFunc->getBounds();
@@ -1887,7 +1899,11 @@ bool SlaOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading,
 			FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
 		}
 	}
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 3, 0)
+	else if ((func->getType() == Function::Type::Exponential) || (func->getType() == Function::Type::Sampled))
+#else
 	else if ((func->getType() == 2) || (func->getType() == 0))
+#endif
 	{
 		GfxColor stop1;
 		shading->getColor(0.0, &stop1);
-- 
2.44.0