summaryrefslogtreecommitdiffstats
path: root/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-04-30 01:48:37 +0200
committerSlávek Banko <slavek.banko@axis.cz>2022-04-30 01:48:37 +0200
commit9adc0f647c04e84792be63d913274633cc2ecd65 (patch)
tree64be526e774ba9621fa2a45dfd8e825594739869 /tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
parentce555091ab20ebb0aa03fee2accd095e5a6c5687 (diff)
downloadtdegraphics-9adc0f647c04e84792be63d913274633cc2ecd65.tar.gz
tdegraphics-9adc0f647c04e84792be63d913274633cc2ecd65.zip
Add support for Poppler >= 22.03.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp')
-rw-r--r--tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp
index 78e8befe..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 {