Download raw body.
editors/libreoffice: fix build with new poppler
ok
On 29/10/25 21:21 +0100, Matthias Kilian wrote:
> Hi,
>
> this fixes the build of editors/libreoffice with the new version of
> poppler. Patches picked from upstream.
>
> Ok?
>
> Ciao,
> Kili
>
> Index: patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx
> ===================================================================
> RCS file: patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx
> diff -N patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx 27 Oct 2025 20:41:43 -0000
> @@ -0,0 +1,44 @@
> +Fix build with poppler-25.10.0.
> +
> +From upstream commits ae83e577501c504f89b434606f05ff1d555729c9 and
> +89841fc69446a597b24b978344cd3c8d656aae09.
> +
> +Index: sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
> +--- sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx.orig
> ++++ sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
> +@@ -203,6 +203,22 @@ int main(int argc, char **argv)
> + // PDFDoc takes over ownership for all strings below
> + GooString* pFileName = new GooString(myStringToStdString(argv[1]));
> +
> ++#if POPPLER_CHECK_VERSION(22, 6, 0)
> ++ std::optional<GooString> ownerPasswordStr = {};
> ++ if (aPwBuf[0] != 0) {
> ++ ownerPasswordStr = std::make_optional<GooString>(aPwBuf);
> ++ } else if (ownerPassword) {
> ++ ownerPasswordStr = std::make_optional<GooString>(myStringToStdString(ownerPassword));
> ++ }
> ++ std::optional<GooString> userPasswordStr = {};
> ++ if (aPwBuf[0] != 0) {
> ++ userPasswordStr = std::make_optional<GooString>(aPwBuf);
> ++ } else if (userPassword) {
> ++ userPasswordStr = std::make_optional<GooString>(myStringToStdString(userPassword));
> ++ }
> ++ pDocUnique = std::make_unique<PDFDoc>(
> ++ std::unique_ptr<GooString>(pFileName), ownerPasswordStr, userPasswordStr);
> ++#else
> + // check for password string(s)
> + GooString* pOwnerPasswordStr(aPwBuf[0] != 0
> + ? new GooString(aPwBuf)
> +@@ -214,12 +230,6 @@ int main(int argc, char **argv)
> + : (userPassword
> + ? new GooString(myStringToStdString(userPassword))
> + : nullptr));
> +-#if POPPLER_CHECK_VERSION(22, 6, 0)
> +- pDocUnique = std::unique_ptr<PDFDoc>(
> +- new PDFDoc(std::make_unique<GooString>(pFileName),
> +- std::optional<GooString>(pOwnerPasswordStr),
> +- std::optional<GooString>(pUserPasswordStr)));
> +-#else
> + pDocUnique = std::unique_ptr<PDFDoc>(
> + new PDFDoc(pFileName, pOwnerPasswordStr, pUserPasswordStr));
> + #endif
--
Regards,
Robert Nagy
editors/libreoffice: fix build with new poppler