Commit 4954395d authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

PDF: Only enable the signatures without page feature with poppler 0.89

poppler 0.88 is crashy when using the signatures() method.

Use poppler's own version defines to check for 0.89 (since there's no
new api added in 0.89 we can't check it like the others)
parent 7eb37c99
Pipeline #20294 passed with stage
in 7 minutes and 58 seconds
......@@ -104,16 +104,6 @@ int main()
}
" HAVE_POPPLER_0_87)
check_cxx_source_compiles("
#include <poppler-qt5.h>
int main()
{
Poppler::Document *d = nullptr;
d->signatures();
return 0;
}
" HAVE_POPPLER_0_88)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-okular-poppler.h
......
......@@ -25,5 +25,3 @@
/* Defined if we have the 0.87 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_87 1
/* Defined if we have the 0.88 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_88 1
......@@ -72,6 +72,12 @@ Q_DECLARE_METATYPE(const Poppler::LinkMovie*)
Q_DECLARE_METATYPE(const Poppler::LinkRendition*)
Q_DECLARE_METATYPE(const Poppler::LinkOCGState*)
#ifdef HAVE_POPPLER_0_73
#define POPPLER_VERSION_MACRO ((POPPLER_VERSION_MAJOR<<16)|(POPPLER_VERSION_MINOR<<8)|(POPPLER_VERSION_MICRO))
#else
#define POPPLER_VERSION_MACRO 0
#endif
static const int defaultPageWidth = 595;
static const int defaultPageHeight = 842;
......@@ -772,7 +778,7 @@ void PDFGenerator::loadPages(QVector<Okular::Page*> &pagesVector, int rotation,
page->setLabel( p->label() );
QLinkedList<Okular::FormField*> okularFormFields;
#ifdef HAVE_POPPLER_0_88
#if POPPLER_VERSION_MACRO >= QT_VERSION_CHECK(0, 89, 0)
if ( i > 0 ) // for page 0 we handle the form fields at the end
okularFormFields = getFormFields( p );
#else
......@@ -802,7 +808,7 @@ void PDFGenerator::loadPages(QVector<Okular::Page*> &pagesVector, int rotation,
// we do that because there's signatures that don't belong to any page, but okular needs a page<->signature mapping
if ( count > 0 )
{
#ifdef HAVE_POPPLER_0_88
#if POPPLER_VERSION_MACRO >= QT_VERSION_CHECK(0, 89, 0)
const QVector<Poppler::FormFieldSignature*> allSignatures = pdfdoc->signatures();
Poppler::Page * page0 = pdfdoc->page( 0 );
QLinkedList<Okular::FormField*> page0FormFields = getFormFields( page0 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment