Commit 41c3490a authored by Evangelos Foutras's avatar Evangelos Foutras 🐱 Committed by Volker Krause
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 274e3878
Pipeline #73039 passed with stage
in 10 minutes and 3 seconds
...@@ -201,7 +201,11 @@ int PdfDocument::fileSize() const ...@@ -201,7 +201,11 @@ int PdfDocument::fileSize() const
} }
#ifdef HAVE_POPPLER #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) static QDateTime parsePdfDateTime(const char *str)
#endif
{ {
int year, month, day, hour, min, sec, tzHours, tzMins; int year, month, day, hour, min, sec, tzHours, tzMins;
char tz; char tz;
...@@ -233,7 +237,9 @@ QDateTime PdfDocument::creationTime() const ...@@ -233,7 +237,9 @@ QDateTime PdfDocument::creationTime() const
if (!dt) { if (!dt) {
return {}; 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()); return parsePdfDateTime(dt->c_str());
#else #else
return parsePdfDateTime(dt->getCString()); return parsePdfDateTime(dt->getCString());
...@@ -250,7 +256,9 @@ QDateTime PdfDocument::modificationTime() const ...@@ -250,7 +256,9 @@ QDateTime PdfDocument::modificationTime() const
if (!dt) { if (!dt) {
return {}; 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()); return parsePdfDateTime(dt->c_str());
#else #else
return parsePdfDateTime(dt->getCString()); 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