From 2a26f8bf97c534e9c85ca936eb71d65fddd7fa82 Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sat, 7 Feb 2026 22:44:48 +0300 Subject: tdefile-plugins: add support for poppler >= 26.01.0 Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tdegraphics/issues/149 Signed-off-by: Alexander Golubev --- tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp | 12 ++++++++++++ tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp | 2 ++ 2 files changed, 14 insertions(+) diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp index 7a64af81..75bd59a3 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cpp @@ -144,7 +144,11 @@ TQString Page::getText(const Rectangle &r) const if (r.isNull()) { rect = p->getCropBox(); +#if (POPPLER_VERSION_C >= 26001000) + s = output_dev->getText(PDFRectangle(rect->x1, rect->y1, rect->x2, rect->y2)); +#else s = output_dev->getText(rect->x1, rect->y1, rect->x2, rect->y2); +#endif } else { @@ -152,7 +156,11 @@ TQString Page::getText(const Rectangle &r) const height = p->getCropHeight(); y1 = height - r.m_y2; y2 = height - r.m_y1; +#if (POPPLER_VERSION_C >= 26001000) + s = output_dev->getText(PDFRectangle(r.m_x1, y1, r.m_x2, y2)); +#else s = output_dev->getText(r.m_x1, y1, r.m_x2, y2); +#endif } # if (POPPLER_VERSION_C >= 25001000) @@ -200,9 +208,13 @@ TQValueList Page::textList() const for (int i = 0; i < word_list->getLength(); i++) { TextWord *word = word_list->get(i); # endif +# if (POPPLER_VERSION_C >= 26001000) + TQString string = TQString::fromUtf8(word->getText()->c_str()); +# else GooString *word_str = word->getText(); TQString string = TQString::fromUtf8(word_str->GOO_GET_CSTR()); delete word_str; +# endif double xMin, yMin, xMax, yMax; word->getBBox(&xMin, &yMin, &xMax, &yMax); diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp index d5c028d1..16312a34 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cpp @@ -25,6 +25,8 @@ #include +#include + #include #include -- cgit v1.2.3