From 24f96355f9cca4068cdde5139b4ad783ec645d12 Mon Sep 17 00:00:00 2001 From: kili Date: Thu, 30 Oct 2025 20:53:46 +0000 Subject: [PATCH] Fix build with poppler-25.10.0. ok robert@ --- ...urce_pdfimport_xpdfwrapper_wrapper_gpl_cxx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 editors/libreoffice/patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx diff --git a/editors/libreoffice/patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx b/editors/libreoffice/patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx new file mode 100644 index 00000000000..6c0ab551a5b --- /dev/null +++ b/editors/libreoffice/patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx @@ -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 ownerPasswordStr = {}; ++ if (aPwBuf[0] != 0) { ++ ownerPasswordStr = std::make_optional(aPwBuf); ++ } else if (ownerPassword) { ++ ownerPasswordStr = std::make_optional(myStringToStdString(ownerPassword)); ++ } ++ std::optional userPasswordStr = {}; ++ if (aPwBuf[0] != 0) { ++ userPasswordStr = std::make_optional(aPwBuf); ++ } else if (userPassword) { ++ userPasswordStr = std::make_optional(myStringToStdString(userPassword)); ++ } ++ pDocUnique = std::make_unique( ++ std::unique_ptr(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( +- new PDFDoc(std::make_unique(pFileName), +- std::optional(pOwnerPasswordStr), +- std::optional(pUserPasswordStr))); +-#else + pDocUnique = std::unique_ptr( + new PDFDoc(pFileName, pOwnerPasswordStr, pUserPasswordStr)); + #endif