From e7a848c7aa5735cba4712d73f819a3e2b9883730 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Tue, 21 May 2019 13:33:17 +0900 Subject: Add support fo Poppler >= 0.76 Follow Catalog::find_page argments change and GooList removal. Signed-off-by: OBATA Akio --- .../dependencies/poppler-tqt/poppler-document.cc | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc') diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc index 74e22913..13eb5cc6 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc @@ -127,23 +127,34 @@ TQValueList Document::fonts() const bool Document::scanForFonts( int numPages, TQValueList *fontList ) const { - GooList *items = data->m_fontInfoScanner->scan( numPages ); + FONTS_LIST_TYPE *items = data->m_fontInfoScanner->scan( numPages ); if ( NULL == items ) return false; - for ( int i = 0; i < items->getLength(); ++i ) { + for ( int i = 0; i < FONTS_LIST_LENGTH(items); ++i ) { TQString fontName; - if (((::FontInfo*)items->get(i))->getName()) - fontName = ((::FontInfo*)items->get(i))->getName()->GOO_GET_CSTR(); + ::FontInfo *fontInfo = +#if defined(HAVE_POPPLER_076) + (*items)[i]; +#else + (::FontInfo*)items->get(i); +#endif + if (fontInfo->getName()) + fontName = fontInfo->getName()->GOO_GET_CSTR(); FontInfo font(fontName, - ((::FontInfo*)items->get(i))->getEmbedded(), - ((::FontInfo*)items->get(i))->getSubset(), - (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()); + fontInfo->getEmbedded(), + fontInfo->getSubset(), + (Poppler::FontInfo::Type)(fontInfo->getType())); fontList->append(font); } -# if defined(HAVE_POPPLER_070) +# if defined(HAVE_POPPLER_076) + for (auto entry : *items) { + delete entry; + } + delete items; +# elif defined(HAVE_POPPLER_070) deleteGooList<::FontInfo>(items); # else deleteGooList(items, ::FontInfo); @@ -324,12 +335,12 @@ TQDomDocument *Document::toc() const if ( !outline ) return NULL; - CONST_064 GooList * items = outline->getItems(); - if ( !items || items->getLength() < 1 ) + OUTLINE_ITEMS_TYPE * items = outline->getItems(); + if ( !items || OUTLINE_ITEMS_LENGTH(items) < 1 ) return NULL; TQDomDocument *toc = new TQDomDocument(); - if ( items->getLength() > 0 ) + if ( OUTLINE_ITEMS_LENGTH(items) > 0 ) data->addTocChildren( toc, toc, items ); return toc; -- cgit v1.2.1