diff options
Diffstat (limited to 'tdefile-plugins/dependencies')
5 files changed, 49 insertions, 18 deletions
diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake index a0cdabad..9f55e6be 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake +++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake @@ -24,7 +24,7 @@ check_cxx_source_compiles(" HAVE_POPPLER_030 ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) -foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 ) +foreach( _poppler_ver 0.58 0.64 0.70 0.71 0.72 0.76 ) string( REPLACE "." "" _poppler_str "${_poppler_ver}" ) if( NOT DEFINED HAVE_POPPLER_${_poppler_str} ) message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" ) 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; diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc index c8fa8984..52d7e4ab 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-link.cc @@ -53,7 +53,7 @@ namespace Poppler { else { Ref ref = ld->getPageRef(); - m_pageNum = data.doc->doc.findPage( ref.num, ref.gen ); + m_pageNum = data.doc->doc.findPage(FIND_PAGE_ARGS(ref)); } double left = ld->getLeft(); double bottom = ld->getBottom(); diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc index e69d46c4..059bf1c0 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.cc @@ -86,13 +86,18 @@ GooString *TQStringToGooString(const TQString &s) } -void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, CONST_064 GooList * items ) +void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, OUTLINE_ITEMS_TYPE * items ) { - int numItems = items->getLength(); + int numItems = OUTLINE_ITEMS_LENGTH(items); for ( int i = 0; i < numItems; ++i ) { // iterate over every object in 'items' - OutlineItem * outlineItem = (OutlineItem *)items->get( i ); + OutlineItem * outlineItem = +#ifdef HAVE_POPPLER_076 + (*items)[i]; +#else + (OutlineItem *)items->get( i ); +#endif // 1. create element using outlineItem's title as tagName TQString name; @@ -138,7 +143,7 @@ void DocumentData::addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, C // 3. recursively descend over children outlineItem->open(); - CONST_064 GooList * children = outlineItem->getKids(); + OUTLINE_ITEMS_TYPE * children = outlineItem->getKids(); if ( children ) addTocChildren( docSyn, &item, children ); } diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h index 74a22596..33b8cfc3 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h @@ -49,6 +49,21 @@ class SplashOutputDev; #else #define GOO_GET_CSTR getCString #endif +#if defined(HAVE_POPPLER_076) +#include <vector> +class OutlineItem; +#define OUTLINE_ITEMS_TYPE const std::vector<OutlineItem*> +#define OUTLINE_ITEMS_LENGTH(goo) goo->size() +#define FONTS_LIST_TYPE std::vector<::FontInfo*> +#define FONTS_LIST_LENGTH(goo) goo->size() +#define FIND_PAGE_ARGS(ref) ref +#else +#define OUTLINE_ITEMS_TYPE CONST_064 GooList +#define OUTLINE_ITEMS_LENGTH(goo) goo->getLength() +#define FONTS_LIST_TYPE GooList +#define FONTS_LIST_LENGTH(goo) goo->getLength() +#define FIND_PAGE_ARGS(ref) ref.num, ref.gen +#endif namespace Poppler { @@ -99,7 +114,7 @@ class DocumentData { return m_outputDev; } - void addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, CONST_064 GooList * items ); + void addTocChildren( TQDomDocument * docSyn, TQDomNode * parent, OUTLINE_ITEMS_TYPE * items ); class PDFDoc doc; bool locked; |