From 9adc0f647c04e84792be63d913274633cc2ecd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 30 Apr 2022 01:48:37 +0200 Subject: Add support for Poppler >= 22.03. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tdefile-plugins/dependencies/poppler-tqt/poppler-document.cpp') 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(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(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 { -- cgit v1.2.1