From b08afae7e41fd5ca3a4101de07366783b17b3887 Mon Sep 17 00:00:00 2001
From: Xisco Fauli <xiscofauli@libreoffice.org>
Date: Wed, 3 Jun 2026 17:37:11 +0200
Subject: [PATCH] poppler: upgrade to 26.06

Downloaded from https://poppler.freedesktop.org/poppler-26.06.0.tar.xz

Change-Id: Idbcf3baf344f7400dad28d06e4a2b18118e647f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205964
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
---
 download.lst                                  |  4 ++--
 external/poppler/disable-freetype.patch.1     |  4 ++--
 external/poppler/poppler-config.patch.1       | 12 +++++------
 .../pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx  | 20 +++++++++++++++++--
 4 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 18c855908f024..ed91b55533349 100644
--- 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
