Add support for Poppler >= 0.71.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/7/head
Slávek Banko 6 years ago
parent d0243fcc86
commit aa4563ad70
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1,6 +1,8 @@
#cmakedefine VERSION "@VERSION@" #cmakedefine VERSION "@VERSION@"
// poppler-tqt // poppler-tqt
#cmakedefine HAVE_POPPLER_071
#cmakedefine HAVE_POPPLER_070
#cmakedefine HAVE_POPPLER_064 #cmakedefine HAVE_POPPLER_064
#cmakedefine HAVE_POPPLER_058 #cmakedefine HAVE_POPPLER_058
#cmakedefine HAVE_POPPLER_030 #cmakedefine HAVE_POPPLER_030

@ -24,24 +24,16 @@ check_cxx_source_compiles("
HAVE_POPPLER_030 ) HAVE_POPPLER_030 )
tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
if( NOT DEFINED HAVE_POPPLER_058 ) foreach( _poppler_ver 0.58 0.64 0.70 0.71 )
message( STATUS "Performing Test HAVE_POPPLER_058" ) string( REPLACE "." "" _poppler_str "${_poppler_ver}" )
if( NOT POPPLER_VERSION VERSION_LESS "0.58" ) if( NOT DEFINED HAVE_POPPLER_${_poppler_str} )
set( HAVE_POPPLER_058 1 CACHE INTERNAL "" FORCE ) message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str}" )
message( STATUS "Performing Test HAVE_POPPLER_058 - Success" ) if( NOT POPPLER_VERSION VERSION_LESS "${_poppler_ver}" )
else( ) set( HAVE_POPPLER_${_poppler_str} 1 CACHE INTERNAL "" FORCE )
set( HAVE_POPPLER_058 "" CACHE INTERNAL "" FORCE ) message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str} - Success" )
message( STATUS "Performing Test HAVE_POPPLER_058 - Failed" ) else( )
set( HAVE_POPPLER_${_poppler_str} "" CACHE INTERNAL "" FORCE )
message( STATUS "Performing Test HAVE_POPPLER_${_poppler_str} - Failed" )
endif( )
endif( ) endif( )
endif( ) endforeach( )
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( )

@ -33,7 +33,9 @@
#include <DateInfo.h> #include <DateInfo.h>
#include "poppler-private.h" #include "poppler-private.h"
#if !defined(HAVE_POPPLER_071)
#undef bool #undef bool
#endif
namespace Poppler { namespace Poppler {
@ -141,7 +143,11 @@ bool Document::scanForFonts( int numPages, TQValueList<FontInfo> *fontList ) con
(Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()); (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType());
fontList->append(font); fontList->append(font);
} }
# if defined(HAVE_POPPLER_070)
deleteGooList<::FontInfo>(items);
# else
deleteGooList(items, ::FontInfo); deleteGooList(items, ::FontInfo);
# endif
return true; return true;
} }

@ -125,7 +125,7 @@ TQString Page::getText(const Rectangle &r) const
{ {
TextOutputDev *output_dev; TextOutputDev *output_dev;
GooString *s; GooString *s;
PDFRectangle *rect; const PDFRectangle *rect;
TQString result; TQString result;
::Page *p; ::Page *p;

@ -39,6 +39,11 @@ class SplashOutputDev;
#else #else
#define CONST_064 #define CONST_064
#endif #endif
#if defined(HAVE_POPPLER_071)
#define GBool bool
#define gTrue true
#define gFalse false
#endif
namespace Poppler { namespace Poppler {

Loading…
Cancel
Save