summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/kitinerary/e99d101e2bd4c32566e238ce1340a93781e19eee.patch
blob: 1bc9dc377f0e220b6dc88d57bf9d802b09d04f2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From e99d101e2bd4c32566e238ce1340a93781e19eee Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Mon, 2 Aug 2021 01:01:31 +0300
Subject: [PATCH] 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
---
 src/lib/pdf/pdfdocument.cpp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/lib/pdf/pdfdocument.cpp b/src/lib/pdf/pdfdocument.cpp
index 8f0f4cd..0eabf45 100644
--- a/src/lib/pdf/pdfdocument.cpp
+++ b/src/lib/pdf/pdfdocument.cpp
@@ -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());