diff options
author | OBATA Akio <[email protected]> | 2019-05-21 13:33:17 +0900 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2019-05-21 18:02:47 +0200 |
commit | b9469c0263ea3bf1e72a3dd364bb42e3d6f47a7c (patch) | |
tree | 69fd0b9c66bd88f6b426063f113ca8fd6d97cc41 /tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc | |
parent | 57535f3efb857b11838ed6e1b8c70b70802c81f0 (diff) | |
download | tdegraphics-b9469c0263ea3bf1e72a3dd364bb42e3d6f47a7c.tar.gz tdegraphics-b9469c0263ea3bf1e72a3dd364bb42e3d6f47a7c.zip |
Add support fo Poppler >= 0.76
Follow Catalog::find_page argments change and GooList removal.
Signed-off-by: OBATA Akio <[email protected]>
(cherry picked from commit e7a848c7aa5735cba4712d73f819a3e2b9883730)
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; |