File 1387-fix-poppler-25-11.patch of Package OpenBoard
From 0beaa9c088728cd51928cedad4847f4ccd48cd2a Mon Sep 17 00:00:00 2001
From: Vekhir <Vekhir@yahoo.com>
Date: Mon, 8 Dec 2025 00:07:19 +0100
Subject: [PATCH] Explicit cast to string_view
Poppler 25.12 allows string_view and char*. QByteArray can be converted to both, so choose one explicitly
---
src/pdf/XPDFRenderer.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/pdf/XPDFRenderer.cpp b/src/pdf/XPDFRenderer.cpp
index e8eb1c64d..23b76a9aa 100644
--- a/src/pdf/XPDFRenderer.cpp
+++ b/src/pdf/XPDFRenderer.cpp
@@ -61,7 +61,9 @@ XPDFRenderer::XPDFRenderer(const QString &filename, bool importingFile)
#endif
globalParams->setupBaseFonts(QFile::encodeName(UBPlatformUtils::applicationResourcesDirectory() + "/" + "fonts").data());
}
-#if POPPLER_VERSION_MAJOR > 22 || (POPPLER_VERSION_MAJOR == 22 && POPPLER_VERSION_MINOR >= 3)
+#if POPPLER_VERSION_MAJOR > 25 || (POPPLER_VERSION_MAJOR == 25 && POPPLER_VERSION_MINOR >= 12)
+ mDocument = new PDFDoc(std::make_unique<GooString>(static_cast<std::string_view>(filename.toLocal8Bit())));
+#elif POPPLER_VERSION_MAJOR > 22 || (POPPLER_VERSION_MAJOR == 22 && POPPLER_VERSION_MINOR >= 3)
mDocument = new PDFDoc(std::make_unique<GooString>(filename.toLocal8Bit()));
#else
mDocument = new PDFDoc(new GooString(filename.toLocal8Bit()), 0, 0, 0); // the filename GString is deleted on PDFDoc desctruction