sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |   12 ++++++++++
 sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx      |   20 ++++++++++++++++++
 2 files changed, 32 insertions(+)

New commits:
commit 04b92e6eab3d58e90efa04165dec4f04e9131690
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jun 17 10:41:25 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jun 18 08:47:24 2025 +0200

    tdf#167010: fix build when poppler is older than 25.2.0
    
    After
    commit 4f13305178c1bf88dffceb42ec15d0944b808a5c
    Author: Xisco Fauli <xiscofa...@libreoffice.org>
    Date:   Wed Apr 2 16:27:00 2025 +0200
    
        poppler: upgrade to 25.04.0
    
    and the upstream commit
    commit 5d71c95d08aa0e097f711254e1c69ee0cf275328
    Author: Nelson Benítez León <nbenit...@gmail.com>
    Date:   Sun Jan 5 21:33:23 2025 +0000
    
        Detect malformed Streams in Annot Appearances
    
    Change-Id: Id308aac0331a77aca88ebf8e31bf3aa0a688533a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186599
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 604ba3b7db2c..f4b03f067827 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -231,8 +231,12 @@ static void writeJpeg_( OutputBuffer& o_rOutputBuf, 
Stream* str )
 #else
     str = ((DCTStream *)str)->getRawStream();
 #endif
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!str->reset())
         return;
+#else
+    str->reset();
+#endif
 
     o_rOutputBuf.clear();
     ExtractJpegData(str, o_rOutputBuf);
@@ -268,8 +272,12 @@ static void writePbm_(OutputBuffer& o_rOutputBuf, Stream* 
str, int width, int he
     o_rOutputBuf.resize(header_size);
 
     // initialize stream
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!str->reset())
         return;
+#else
+    str->reset();
+#endif
 
     // copy the raw stream
     if( bInvert )
@@ -326,8 +334,12 @@ static void writePpm_( OutputBuffer&     o_rOutputBuf,
                         width,
                         colorMap->getNumPixelComps(),
                         colorMap->getBits()));
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!imgStr->reset())
         return;
+#else
+    imgStr->reset();
+#endif
 
     for( int y=0; y<height; ++y)
     {
diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
index c0547e761e59..e21d9192f563 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx
@@ -214,8 +214,12 @@ void PngHelper::createPng( OutputBuffer&     o_rOutputBuf,
     int nLineSize = (width + 7)/8;
     aScanlines.reserve( nLineSize * height + height );
 
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!str->reset())
         return;
+#else
+    str->reset();
+#endif
     for( int y = 0; y < height; y++ )
     {
         // determine filter type (none) for this scanline
@@ -253,8 +257,12 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
                         width,
                         colorMap->getNumPixelComps(),
                         colorMap->getBits()));
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!imgStr->reset())
         return;
+#else
+    imgStr->reset();
+#endif
 
     // create scan line data buffer
     OutputBuffer aScanlines;
@@ -291,8 +299,12 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
                         maskColorMap->getNumPixelComps(),
                         maskColorMap->getBits()));
 
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!imgStrMask->reset())
         return;
+#else
+    imgStrMask->reset();
+#endif
 
     for( int y = 0; y < maskHeight; ++y )
     {
@@ -341,8 +353,12 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
                         width,
                         colorMap->getNumPixelComps(),
                         colorMap->getBits()));
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!imgStr->reset())
         return;
+#else
+    imgStr->reset();
+#endif
 
     // create scan line data buffer
     OutputBuffer aScanlines;
@@ -376,8 +392,12 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf,
     std::unique_ptr<ImageStream> imgStrMask(
         new ImageStream(maskStr, maskWidth, 1, 1));
 
+#if POPPLER_CHECK_VERSION(25, 2, 0)
     if (!imgStrMask->reset())
         return;
+#else
+    imgStrMask->reset();
+#endif
 
     for( int y = 0; y < maskHeight; ++y )
     {

Reply via email to