summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-09-23 15:48:31 +0200
committerSlávek Banko <slavek.banko@axis.cz>2021-09-23 15:50:40 +0200
commit4483598f8498f503cff24f87316d91a374981a07 (patch)
treea3a889653ee62ee9647aeb30ee229651b470674f
parentca22775edeb78e186a3ded45d004316748f084eb (diff)
downloadtdegraphics-4483598f8498f503cff24f87316d91a374981a07.tar.gz
tdegraphics-4483598f8498f503cff24f87316d91a374981a07.zip
Add support for Poppler >= 21.08.
This resolves issue #34. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit d9a5befb4fdba51b1dfb82d60e0727575ec2e1d0)
-rw-r--r--config.h.cmake1
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake2
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp9
3 files changed, 9 insertions, 3 deletions
diff --git a/config.h.cmake b/config.h.cmake
index 5b88585c..b3b6d1ec 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,6 +1,7 @@
#cmakedefine VERSION "@VERSION@"
// poppler-tqt
+#cmakedefine HAVE_POPPLER_2108
#cmakedefine HAVE_POPPLER_086
#cmakedefine HAVE_POPPLER_083
#cmakedefine HAVE_POPPLER_082
diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
index 09ee6878..52f08a4c 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
+++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake
@@ -24,7 +24,7 @@ check_cxx_source_compiles("
HAVE_POPPLER_030 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
-foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 0.83 0.86 )
+foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 0.82 0.83 0.86 21.08 )
string( REPLACE "." "" _poppler_str "${_poppler_ver}" )
if( NOT DEFINED HAVE_POPPLER_${_poppler_str} )
message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" )
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
index fac02a4b..78e8befe 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
@@ -278,9 +278,14 @@ TQDateTime Document::getDate( const TQString & type ) const
#endif
if (!obj.isNull() && obj.isString())
{
- TQString s = UnicodeParsedString(obj.getString());
+# if defined(HAVE_POPPLER_2108)
+ const GooString *s = obj.getString();
+# else
+ TQString tqs = UnicodeParsedString(obj.getString());
+ const char *s = tqs.latin1();
+# endif
// TODO do something with the timezone information
- if ( parseDateString( s.latin1(), &year, &mon, &day, &hour, &min, &sec, &tz, &tz_hour, &tz_minute ) )
+ if (parseDateString(s, &year, &mon, &day, &hour, &min, &sec, &tz, &tz_hour, &tz_minute))
{
TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
TQTime t( hour, min, sec );