diff options
author | OBATA Akio <[email protected]> | 2019-05-21 13:33:17 +0900 |
---|---|---|
committer | OBATA Akio <[email protected]> | 2019-05-21 13:33:17 +0900 |
commit | e7a848c7aa5735cba4712d73f819a3e2b9883730 (patch) | |
tree | 80d8fdbdb0709cdb4fb2e1895fe9ae470d14747f /tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc | |
parent | 4eb49b55f2b9d2412da7fded637134950c2516a1 (diff) | |
download | tdegraphics-e7a848c7aa5735cba4712d73f819a3e2b9883730.tar.gz tdegraphics-e7a848c7aa5735cba4712d73f819a3e2b9883730.zip |
Add support fo Poppler >= 0.76
Follow Catalog::find_page argments change and GooList removal.
Signed-off-by: OBATA Akio <[email protected]>
Diffstat (limited to 'tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc')
-rw-r--r-- | tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc | 33 |
1 files changed, 22 insertions, 11 deletions
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<FontInfo> Document::fonts() const bool Document::scanForFonts( int numPages, TQValueList<FontInfo> *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; |