sdext: adapt xpdfwrapper to poppler 24.12
authorMichael Stahl <michael.stahl@allotropia.de>
Tue, 7 Jan 2025 17:42:29 +0000 (18:42 +0100)
committerRene Engelhard <rene@debian.org>
Mon, 10 Feb 2025 16:55:43 +0000 (17:55 +0100)
Change-Id: Ia47edf2ac821e3ef5c40f7582253f894eac74060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179902
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Gbp-Pq: Name poppler-24.12.diff

sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx

index 57164f27cb42e7b45b685a1919b8fc9302aa756a..6748431e53d28c70c49c866f3697fa6848e1f91c 100644 (file)
@@ -1090,7 +1090,12 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
 
     int bitsPerComponent = 1;
     StreamColorSpaceMode csMode = streamCSNone;
+#if POPPLER_CHECK_VERSION(24, 12, 0)
+    bool hasAlpha;
+    str->getImageParams( &bitsPerComponent, &csMode, &hasAlpha );
+#else
     str->getImageParams( &bitsPerComponent, &csMode );
+#endif
     if( bitsPerComponent == 1 && (csMode == streamCSNone || csMode == streamCSDeviceGray) )
     {
         GfxRGB oneColor = { dblToCol( 1.0 ), dblToCol( 1.0 ), dblToCol( 1.0 ) };
@@ -1305,10 +1310,17 @@ poppler_bool PDFOutDev::tilingPatternFill(GfxState *state, Gfx *, Catalog *,
     std::unique_ptr<MemStream> pAlphaStr(new MemStream(reinterpret_cast<char *>(pSplashBitmap->getAlphaPtr()),
         0, nBitmapWidth * nBitmapHeight, Object(objNull)));
     auto aDecode = Object(objNull);
+#if POPPLER_CHECK_VERSION(24, 10, 0)
+    std::unique_ptr<GfxImageColorMap> pRgbIdentityColorMap(new GfxImageColorMap(8, &aDecode,
+        std::make_unique<GfxDeviceRGBColorSpace>()));
+    std::unique_ptr<GfxImageColorMap> pGrayIdentityColorMap(new GfxImageColorMap(8, &aDecode,
+        std::make_unique<GfxDeviceGrayColorSpace>()));
+#else
     std::unique_ptr<GfxImageColorMap> pRgbIdentityColorMap(new GfxImageColorMap(8, &aDecode,
         new GfxDeviceRGBColorSpace()));
     std::unique_ptr<GfxImageColorMap> pGrayIdentityColorMap(new GfxImageColorMap(8, &aDecode,
         new GfxDeviceGrayColorSpace()));
+#endif
 
     OutputBuffer aBuf; initBuf(aBuf);
     writePng_(aBuf, pRgbStr.get(), nBitmapWidth, nBitmapHeight, pRgbIdentityColorMap.get(),