summaryrefslogtreecommitdiffstats
path: root/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp')
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
index fac02a4b..86e831ee 100644
--- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
+++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
@@ -50,7 +50,11 @@ Document *Document::load(const TQString &filePath)
#endif
}
+# if defined(HAVE_POPPLER_2203)
+ DocumentData *doc = new DocumentData(std::make_unique<GooString>(TQFile::encodeName(filePath)), {});
+# else
DocumentData *doc = new DocumentData(new GooString(TQFile::encodeName(filePath)), NULL);
+# endif
Document *pdoc;
if (doc->doc.isOk() || doc->doc.getErrorCode() == errEncrypted) {
pdoc = new Document(doc);
@@ -84,10 +88,15 @@ bool Document::unlock(const TQCString &password)
{
if (data->locked) {
/* racier then it needs to be */
+# if defined(HAVE_POPPLER_2203)
+ DocumentData *doc2 = new DocumentData(std::make_unique<GooString>(data->doc.getFileName()),
+ GooString(password.data()));
+# else
GooString *filename = new GooString(data->doc.getFileName());
GooString *pwd = new GooString(password.data());
DocumentData *doc2 = new DocumentData(filename, pwd);
delete pwd;
+# endif
if (!doc2->doc.isOk()) {
delete doc2;
} else {
@@ -278,9 +287,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 );