summaryrefslogtreecommitdiff
path: root/app-office/libreoffice/files/libreoffice-25.2.7.2-poppler-26.06.patch
blob: 77a7aa63e2921b3ce1c0869dbc5bf98e0a64192c (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
71
From b08afae7e41fd5ca3a4101de07366783b17b3887 Mon Sep 17 00:00:00 2001
From: Xisco Fauli <xiscofauli@libreoffice.org>
Date: 2026-06-03T15:37:11Z
Subject: [PATCH] pdfimport: support Poppler 26.06 and later

Backport the PDF importer changes from:
https://github.com/LibreOffice/core/commit/b08afae7e41fd5ca3a4101de07366783b17b3887

Keep bundled-Poppler download/configuration changes out of this system-Poppler
build. Version guards preserve support for older Poppler releases.

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -60,6 +60,10 @@
 #include "UTF8.h"
 #endif
 
+#if POPPLER_CHECK_VERSION(26, 6, 0)
+#include <Annot.h>
+#endif
+
 #ifdef _WIN32
 # define snprintf _snprintf
 
@@ -1223,7 +1227,9 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
         {
             GfxRGB aMinRGB;
             colorMap->getColorSpace()->getRGB(
-#if POPPLER_CHECK_VERSION(0, 82, 0)
+#if POPPLER_CHECK_VERSION(26, 6, 0)
+                *reinterpret_cast<const GfxColor*>(maskColors),
+#elif POPPLER_CHECK_VERSION(0, 82, 0)
                 reinterpret_cast<const GfxColor*>(maskColors),
 #else
                 reinterpret_cast<GfxColor*>(maskColors),
@@ -1232,7 +1238,9 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
 
             GfxRGB aMaxRGB;
             colorMap->getColorSpace()->getRGB(
-#if POPPLER_CHECK_VERSION(0, 82, 0)
+#if POPPLER_CHECK_VERSION(26, 6, 0)
+                *(reinterpret_cast<const GfxColor*>(maskColors)+gfxColorMaxComps),
+#elif POPPLER_CHECK_VERSION(0, 82, 0)
                 reinterpret_cast<const GfxColor*>(maskColors)+gfxColorMaxComps,
 #else
                 reinterpret_cast<GfxColor*>(maskColors)+gfxColorMaxComps,
@@ -1365,7 +1373,11 @@ poppler_bool PDFOutDev::tilingPatternFill(GfxState *state, Gfx *, Catalog *,
     aBox.y2 = pBbox[3];
 
     const int nDPI = 72; // GfxState seems to have 72.0 as magic for some reason
+#if POPPLER_CHECK_VERSION(26, 6, 0)
+    auto pSplashGfxState = new GfxState(nDPI, nDPI, aBox, 0, false);
+#else
     auto pSplashGfxState = new GfxState(nDPI, nDPI, &aBox, 0, false);
+#endif
 #if POPPLER_CHECK_VERSION(26, 2, 0)
     auto pSplashOut = new SplashOutputDev(splashModeRGB8, 1, nullptr);
 #else
@@ -1375,7 +1387,11 @@ poppler_bool PDFOutDev::tilingPatternFill(GfxState *state, Gfx *, Catalog *,
     pSplashOut->startDoc(m_pDoc);
     pSplashOut->startPage(0 /* pageNum */, pSplashGfxState, nullptr /* xref */);
 
+#if POPPLER_CHECK_VERSION(26, 6, 0)
+    auto pSplashGfx = new Gfx(m_pDoc, pSplashOut, pResDict, aBox, nullptr);
+#else
     auto pSplashGfx = new Gfx(m_pDoc, pSplashOut, pResDict, &aBox, nullptr);
+#endif
     pSplashGfx->display(aStr);
     std::unique_ptr<SplashBitmap> pSplashBitmap(pSplashOut->takeBitmap());
     // Poppler tells us to free the splash device immediately after taking the