download.lst | 4 - external/poppler/UnpackedTarball_poppler.mk | 1 external/poppler/clang-std-ranges.patch.1 | 49 +++++++++++++++++- external/poppler/disable-freetype.patch.1 | 20 ++----- external/poppler/inc/pch/precompiled_poppler.hxx | 10 +-- external/poppler/pch.patch.0 | 11 ---- sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 9 ++- sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx | 17 ++++-- 8 files changed, 79 insertions(+), 42 deletions(-)
New commits: commit 23a24de3ed996ec56cf452c0ea4e34e16bc5bb9b Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Tue Apr 22 15:59:23 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Apr 29 12:56:57 2025 +0200 poppler: avoid more std::ranges afer update to 25.04.0 Not supported by macOS 12.7 / XCode 14.2 Change-Id: I114190ddc9e36c2660c78a4ea2eb1e7797dadf13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184444 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 8cdbe3666440f81aa71539e8d38d5a93eec17b26) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184644 diff --git a/external/poppler/clang-std-ranges.patch.1 b/external/poppler/clang-std-ranges.patch.1 index c1484d9ab81b..28841ed6a005 100644 --- a/external/poppler/clang-std-ranges.patch.1 +++ b/external/poppler/clang-std-ranges.patch.1 @@ -415,3 +415,48 @@ In file included from /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linu } } +diff -ur poppler.org/poppler/TextOutputDev.cc poppler/poppler/TextOutputDev.cc +--- poppler.org/poppler/TextOutputDev.cc 2025-04-22 15:42:57.000000000 +0200 ++++ poppler/poppler/TextOutputDev.cc 2025-04-22 15:49:06.000000000 +0200 +@@ -2419,7 +2419,11 @@ + } + } + } ++#ifndef __clang__ + std::ranges::sort(words, &TextWord::cmpYX); ++#else ++ std::sort(words.begin(), words.end(), &TextWord::cmpYX); ++#endif + + } else { + for (flow = text->flows; flow; flow = flow->next) { +@@ -4402,9 +4406,17 @@ + // if all lines in the region have the same rotation, use it; + // otherwise, use the page's primary rotation + if (oneRot) { ++#ifndef __clang__ + std::ranges::sort(frags, &TextLineFrag::cmpYXLineRot); ++#else ++ std::sort(frags.begin(), frags.end(), &TextLineFrag::cmpYXLineRot); ++#endif + } else { ++#ifndef __clang__ + std::ranges::sort(frags, &TextLineFrag::cmpYXPrimaryRot); ++#else ++ std::sort(frags.begin(), frags.end(), &TextLineFrag::cmpYXPrimaryRot); ++#endif + } + for (auto it = frags.begin(); it != frags.end();) { + double delta = maxIntraLineDelta * it->line->words->fontSize; +@@ -5416,7 +5428,11 @@ + frags.back().computeCoords(true); + } + } ++#ifndef __clang__ + std::ranges::sort(frags, &TextLineFrag::cmpYXPrimaryRot); ++#else ++ std::sort(frags.begin(), frags.end(), &TextLineFrag::cmpYXPrimaryRot); ++#endif + for (auto it = frags.begin(); it != frags.end();) { + double delta = maxIntraLineDelta * it->line->words->fontSize; + double base = it->base; commit 02bc8eb0985f421921617fff7fc4ee4f5fbad4c9 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Apr 2 16:27:00 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Apr 29 12:56:49 2025 +0200 poppler: upgrade to 25.04.0 After 032d035220702523cf10d924fd436c9e6c83d24c "Enforce error checking on stream::reset" the return from reset has to be checked, otherwise it fails with error: ignoring return value of ‘bool ImageStream::reset()’, declared with attribute ‘nodiscard’ [-Werror=unused-result] Downloaded from https://poppler.freedesktop.org/poppler-25.04.0.tar.xz Change-Id: I5c6022b11c307f4293e4b2ea566e811053e3ab6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183632 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 4f13305178c1bf88dffceb42ec15d0944b808a5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184642 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/download.lst b/download.lst index 641bb2f60cfc..3d4b96bded52 100644 --- a/download.lst +++ b/download.lst @@ -543,8 +543,8 @@ LIBTIFF_TARBALL := tiff-4.7.0.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -POPPLER_SHA256SUM := 21234cb2a9647d73c752ce4031e65a79d11a511a835f2798284c2497b8701dee -POPPLER_TARBALL := poppler-25.02.0.tar.xz +POPPLER_SHA256SUM := b010c596dce127fba88532fd2f1043e55ea30601767952d0f2c0a80e7dc0da3d +POPPLER_TARBALL := poppler-25.04.0.tar.xz POPPLER_DATA_SHA256SUM := c835b640a40ce357e1b83666aabd95edffa24ddddd49b8daff63adb851cdab74 POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz # three static lines diff --git a/external/poppler/clang-std-ranges.patch.1 b/external/poppler/clang-std-ranges.patch.1 index 0ba895cf1024..c1484d9ab81b 100644 --- a/external/poppler/clang-std-ranges.patch.1 +++ b/external/poppler/clang-std-ranges.patch.1 @@ -311,8 +311,8 @@ In file included from /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linu } lines.push_back(std::move(words)); -@@ -5456,7 +5460,11 @@ - for (word = rawWords; word; word = word->next) { +@@ -5385,7 +5385,11 @@ + for (TextWord *word = rawWords; word; word = word->next) { s.clear(); uText.resize(word->len()); +#ifndef __clang__ diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 6748431e53d2..d4310a6556ff 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -231,7 +231,8 @@ static void writeJpeg_( OutputBuffer& o_rOutputBuf, Stream* str ) #else str = ((DCTStream *)str)->getRawStream(); #endif - str->reset(); + if (!str->reset()) + return; o_rOutputBuf.clear(); ExtractJpegData(str, o_rOutputBuf); @@ -267,7 +268,8 @@ static void writePbm_(OutputBuffer& o_rOutputBuf, Stream* str, int width, int he o_rOutputBuf.resize(header_size); // initialize stream - str->reset(); + if (!str->reset()) + return; // copy the raw stream if( bInvert ) @@ -324,7 +326,8 @@ static void writePpm_( OutputBuffer& o_rOutputBuf, width, colorMap->getNumPixelComps(), colorMap->getBits())); - imgStr->reset(); + if (!imgStr->reset()) + return; for( int y=0; y<height; ++y) { diff --git a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx index 798555fe2f54..c0547e761e59 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx @@ -214,7 +214,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, int nLineSize = (width + 7)/8; aScanlines.reserve( nLineSize * height + height ); - str->reset(); + if (!str->reset()) + return; for( int y = 0; y < height; y++ ) { // determine filter type (none) for this scanline @@ -252,7 +253,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, width, colorMap->getNumPixelComps(), colorMap->getBits())); - imgStr->reset(); + if (!imgStr->reset()) + return; // create scan line data buffer OutputBuffer aScanlines; @@ -289,7 +291,9 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, maskColorMap->getNumPixelComps(), maskColorMap->getBits())); - imgStrMask->reset(); + if (!imgStrMask->reset()) + return; + for( int y = 0; y < maskHeight; ++y ) { pm = imgStrMask->getLine(); @@ -337,7 +341,8 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, width, colorMap->getNumPixelComps(), colorMap->getBits())); - imgStr->reset(); + if (!imgStr->reset()) + return; // create scan line data buffer OutputBuffer aScanlines; @@ -371,7 +376,9 @@ void PngHelper::createPng( OutputBuffer& o_rOutputBuf, std::unique_ptr<ImageStream> imgStrMask( new ImageStream(maskStr, maskWidth, 1, 1)); - imgStrMask->reset(); + if (!imgStrMask->reset()) + return; + for( int y = 0; y < maskHeight; ++y ) { for( int x = 0; x < maskWidth; ++x ) commit ca2cc959e568b1fd41f47d8b9c8f49cb1b14b1be Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Feb 25 14:09:16 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Apr 29 12:56:43 2025 +0200 related tdf#165433: poppler: upgrade to 25.02.0 Downloaded from https://poppler.freedesktop.org/poppler-25.02.0.tar.xz Change-Id: I22cf1bd4dc3d27cabd8ce291d3bafd962d3f45f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182169 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins (cherry picked from commit 12c1596b0fd152399bed90f3d26014a32efc24e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184640 diff --git a/download.lst b/download.lst index 2fd45b5c0c96..641bb2f60cfc 100644 --- a/download.lst +++ b/download.lst @@ -543,8 +543,8 @@ LIBTIFF_TARBALL := tiff-4.7.0.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -POPPLER_SHA256SUM := 7eefc122207bbbd72a303c5e0743f4941e8ae861e24dcf0501e18ce1d1414112 -POPPLER_TARBALL := poppler-25.01.0.tar.xz +POPPLER_SHA256SUM := 21234cb2a9647d73c752ce4031e65a79d11a511a835f2798284c2497b8701dee +POPPLER_TARBALL := poppler-25.02.0.tar.xz POPPLER_DATA_SHA256SUM := c835b640a40ce357e1b83666aabd95edffa24ddddd49b8daff63adb851cdab74 POPPLER_DATA_TARBALL := poppler-data-0.4.12.tar.gz # three static lines diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk index 3ebb9bb9492c..2d7a0a939071 100644 --- a/external/poppler/UnpackedTarball_poppler.mk +++ b/external/poppler/UnpackedTarball_poppler.mk @@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\ external/poppler/disable-freetype.patch.1 \ external/poppler/clang-std-ranges.patch.1 \ external/poppler/poppler-config.patch.1 \ - external/poppler/pch.patch.0 \ )) ifneq ($(filter -fsanitize=%,$(CC)),) diff --git a/external/poppler/disable-freetype.patch.1 b/external/poppler/disable-freetype.patch.1 index a4014f2e5fb1..b1a117df0a1f 100644 --- a/external/poppler/disable-freetype.patch.1 +++ b/external/poppler/disable-freetype.patch.1 @@ -53,18 +53,16 @@ disable freetype dependent code SplashFontFile *SplashFontEngine::getFontFile(const SplashFontFileID &id) --- poppler/splash/SplashFTFontEngine.h.orig 2023-09-05 22:15:14.000000000 +0100 +++ poppler/splash/SplashFTFontEngine.h 2024-02-21 13:53:29.715423742 +0000 -@@ -26,8 +26,8 @@ +@@ -27,8 +27,6 @@ #ifndef SPLASHFTFONTENGINE_H #define SPLASHFTFONTENGINE_H -#include <ft2build.h> -#include FT_FREETYPE_H -+//#include <ft2build.h> -+//#include FT_FREETYPE_H #include <memory> + #include <vector> - class SplashFontFile; -@@ -40,7 +40,7 @@ +@@ -43,7 +41,7 @@ class SplashFTFontEngine { public: @@ -73,7 +71,7 @@ disable freetype dependent code ~SplashFTFontEngine(); -@@ -48,22 +48,22 @@ +@@ -51,22 +49,20 @@ SplashFTFontEngine &operator=(const SplashFTFontEngine &) = delete; // Load fonts. @@ -81,26 +79,24 @@ disable freetype dependent code - SplashFontFile *loadType1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex); - SplashFontFile *loadOpenTypeT1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex); - SplashFontFile *loadCIDFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int faceIndex); -- SplashFontFile *loadOpenTypeCFFFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex); -- SplashFontFile *loadTrueTypeFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex); +- SplashFontFile *loadOpenTypeCFFFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex); +- SplashFontFile *loadTrueTypeFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex); + SplashFontFile *loadType1Font(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex) { return nullptr; }; + SplashFontFile *loadType1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex) { return nullptr; }; + SplashFontFile *loadOpenTypeT1CFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, const char **enc, int faceIndex) { return nullptr; }; + SplashFontFile *loadCIDFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int faceIndex) { return nullptr; }; -+ SplashFontFile *loadOpenTypeCFFFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex) { return nullptr; }; -+ SplashFontFile *loadTrueTypeFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, int *codeToGID, int codeToGIDLen, int faceIndex) { return nullptr; }; ++ SplashFontFile *loadOpenTypeCFFFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex) { return nullptr; }; ++ SplashFontFile *loadTrueTypeFont(std::unique_ptr<SplashFontFileID> idA, SplashFontSrc *src, std::vector<int> &&codeToGID, int faceIndex) { return nullptr; }; bool getAA() { return aa; } void setAA(bool aaA) { aa = aaA; } private: - SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA); -+ //SplashFTFontEngine(bool aaA, bool enableFreeTypeHintingA, bool enableSlightHintingA, FT_Library libA); bool aa; bool enableFreeTypeHinting; bool enableSlightHinting; - FT_Library lib; -+ //FT_Library lib; friend class SplashFTFontFile; friend class SplashFTFont; diff --git a/external/poppler/inc/pch/precompiled_poppler.hxx b/external/poppler/inc/pch/precompiled_poppler.hxx index 9351ca348282..b2a9a78d30da 100644 --- a/external/poppler/inc/pch/precompiled_poppler.hxx +++ b/external/poppler/inc/pch/precompiled_poppler.hxx @@ -13,11 +13,11 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2025-01-08 10:27:46 using: - ../master/bin/update_pch ../master/external/poppler poppler --cutoff=1 --exclude:system --include:module --include:local + Generated on 2025-02-25 16:55:58 using: + ./bin/update_pch ./external/poppler poppler --cutoff=1 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: - ./bin/update_pch_bisect ./../master/external/poppler/inc/pch/precompiled_poppler.hxx "make ../master/external/poppler.build" --find-conflicts + ./bin/update_pch_bisect ././external/poppler/inc/pch/precompiled_poppler.hxx "make ./external/poppler.build" --find-conflicts */ #include <sal/config.h> @@ -56,10 +56,10 @@ #include <cstdlib> #include <cstring> #include <ctime> +#include <filesystem> #include <functional> #include <gbase64.h> #include <gbasename.h> -#include <gdir.h> #include <gfile.h> #include <glibc.h> #include <gmem.h> @@ -73,7 +73,6 @@ #include <optional> #include <poppler-config.h> #include <random> -#include <ranges> #include <regex> #include <set> #include <sstream> @@ -96,7 +95,6 @@ #include <goo/JpegWriter.h> #include <goo/PNGWriter.h> #include <goo/TiffWriter.h> -#include <goo/gdir.h> #include <goo/gfile.h> #include <goo/glibc.h> #include <goo/gmem.h> diff --git a/external/poppler/pch.patch.0 b/external/poppler/pch.patch.0 deleted file mode 100644 index 9ffeeb8421f5..000000000000 --- a/external/poppler/pch.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ ---- ./goo/gdir.h.sav 2021-01-02 17:54:42.000000000 +0100 -+++ ./goo/gdir.h 2021-11-03 15:16:04.306277081 +0100 -@@ -37,6 +37,8 @@ - - #include <memory> - -+#include "gfile.h" -+ - class GooString; - - #if defined(_WIN32)