Commit e99d101e authored by Evangelos Foutras's avatar Evangelos Foutras 🐱
Browse files

Fix build with poppler 21.8.0

parseDateString() now takes "const GooString *" as the date argument in
order to support unicode date strings. Adjust parsePdfDateTime() to use
the same string type (instead of "const char *") when compiling against
poppler 21.8.0.

https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/880
parent 236a36f1
Pipeline #73033 passed with stage
in 13 minutes and 1 second
......@@ -201,7 +201,11 @@ int PdfDocument::fileSize() const
}
#ifdef HAVE_POPPLER
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(21, 8, 0)
static QDateTime parsePdfDateTime(const GooString *str)
#else
static QDateTime parsePdfDateTime(const char *str)
#endif
{
int year, month, day, hour, min, sec, tzHours, tzMins;
char tz;
......@@ -233,7 +237,9 @@ QDateTime PdfDocument::creationTime() const
if (!dt) {
return {};
}
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 72, 0)
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(21, 8, 0)
return parsePdfDateTime(dt.get());
#elif KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 72, 0)
return parsePdfDateTime(dt->c_str());
#else
return parsePdfDateTime(dt->getCString());
......@@ -250,7 +256,9 @@ QDateTime PdfDocument::modificationTime() const
if (!dt) {
return {};
}
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 72, 0)
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(21, 8, 0)
return parsePdfDateTime(dt.get());
#elif KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 72, 0)
return parsePdfDateTime(dt->c_str());
#else
return parsePdfDateTime(dt->getCString());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment