From 9d3faa503909ee34a6963172e6f8725a12f554b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 3 Jan 2019 18:52:32 +0100 Subject: Add support for Poppler >= 0.71. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit aa4563ad7056949864cc41f9088626523d79f5ab) --- .../dependencies/poppler-tqt/ConfigureChecks.cmake | 32 ++++++++-------------- .../dependencies/poppler-tqt/poppler-document.cc | 6 ++++ .../dependencies/poppler-tqt/poppler-page.cc | 2 +- .../dependencies/poppler-tqt/poppler-private.h | 5 ++++ 4 files changed, 24 insertions(+), 21 deletions(-) (limited to 'tdefile-plugins') diff --git a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake index 2d2e5136..eab5bcb6 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake +++ b/tdefile-plugins/dependencies/poppler-tqt/ConfigureChecks.cmake @@ -24,24 +24,16 @@ check_cxx_source_compiles(" HAVE_POPPLER_030 ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) -if( NOT DEFINED HAVE_POPPLER_058 ) - message( STATUS "Performing Test HAVE_POPPLER_058" ) - if( NOT POPPLER_VERSION VERSION_LESS "0.58" ) - set( HAVE_POPPLER_058 1 CACHE INTERNAL "" FORCE ) - message( STATUS "Performing Test HAVE_POPPLER_058 - Success" ) - else( ) - set( HAVE_POPPLER_058 "" CACHE INTERNAL "" FORCE ) - message( STATUS "Performing Test HAVE_POPPLER_058 - Failed" ) +foreach( _poppler_ver 0.58 0.64 0.70 0.71 ) + string( REPLACE "." "" _poppler_str "${_poppler_ver}" ) + if( NOT DEFINED HAVE_POPPLER_${_poppler_str} ) + message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" ) + if( NOT POPPLER_VERSION VERSION_LESS "${_poppler_ver}" ) + set( HAVE_POPPLER_${_poppler_str} 1 CACHE INTERNAL "" FORCE ) + message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str} - Success" ) + else( ) + set( HAVE_POPPLER_${_poppler_str} "" CACHE INTERNAL "" FORCE ) + message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str} - Failed" ) + endif( ) endif( ) -endif( ) - -if( NOT DEFINED HAVE_POPPLER_064 ) - message( STATUS "Performing Test HAVE_POPPLER_064" ) - if( NOT POPPLER_VERSION VERSION_LESS "0.64" ) - set( HAVE_POPPLER_064 1 CACHE INTERNAL "" FORCE ) - message( STATUS "Performing Test HAVE_POPPLER_064 - Success" ) - else( ) - set( HAVE_POPPLER_064 "" CACHE INTERNAL "" FORCE ) - message( STATUS "Performing Test HAVE_POPPLER_064 - Failed" ) - endif( ) -endif( ) +endforeach( ) diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc index 9584b104..f05816df 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-document.cc @@ -33,7 +33,9 @@ #include #include "poppler-private.h" +#if !defined(HAVE_POPPLER_071) #undef bool +#endif namespace Poppler { @@ -141,7 +143,11 @@ bool Document::scanForFonts( int numPages, TQValueList *fontList ) con (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()); fontList->append(font); } +# if defined(HAVE_POPPLER_070) + deleteGooList<::FontInfo>(items); +# else deleteGooList(items, ::FontInfo); +# endif return true; } diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc index 45ea5b74..2d83f924 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-page.cc @@ -125,7 +125,7 @@ TQString Page::getText(const Rectangle &r) const { TextOutputDev *output_dev; GooString *s; - PDFRectangle *rect; + const PDFRectangle *rect; TQString result; ::Page *p; diff --git a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h index 56e7cf5e..a98eb22e 100644 --- a/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h +++ b/tdefile-plugins/dependencies/poppler-tqt/poppler-private.h @@ -39,6 +39,11 @@ class SplashOutputDev; #else #define CONST_064 #endif +#if defined(HAVE_POPPLER_071) +#define GBool bool +#define gTrue true +#define gFalse false +#endif namespace Poppler { -- cgit v1.2.1