Don't ask for link annotations, they are slow and we don't use them

Needs poppler 0.28 that is yet to be released

BUGS: 317891
This commit is contained in:
Albert Astals Cid 2014-05-11 18:43:50 +02:00
parent c1ed635770
commit 19a216a275
3 changed files with 36 additions and 3 deletions

View File

@ -125,9 +125,21 @@ int main()
}
" HAVE_POPPLER_0_24)
check_cxx_source_compiles("
#include <poppler-qt4.h>
int main()
{
Poppler::Page *p = 0;
p->annotations( QSet<Poppler::Annotation::SubType>() << Poppler::Annotation::ASound );
return 0;
}
" HAVE_POPPLER_0_28)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
if (HAVE_POPPLER_0_24)
if (HAVE_POPPLER_0_28)
set(popplerVersionMessage "0.28")
elseif (HAVE_POPPLER_0_24)
set(popplerVersionMessage "0.24")
elseif (HAVE_POPPLER_0_22)
set(popplerVersionMessage "0.22")
@ -137,9 +149,9 @@ int main()
set(popplerVersionMessage "0.16")
elseif (HAVE_POPPLER_0_12_1)
set(popplerVersionMessage "0.12.1")
else (HAVE_POPPLER_0_24)
else (HAVE_POPPLER_0_28)
set(popplerVersionMessage "0.5.4")
endif (HAVE_POPPLER_0_24)
endif (HAVE_POPPLER_0_28)
if (NOT Poppler_FIND_QUIETLY)
message(STATUS "Found Poppler-Qt4: ${POPPLER_LIBRARY}, (>= ${popplerVersionMessage})")
endif (NOT Poppler_FIND_QUIETLY)

View File

@ -12,3 +12,6 @@
/* Defined if we have the 0.24 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_24 1
/* Defined if we have the 0.28 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_28 1

View File

@ -1429,7 +1429,25 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, QDomNode * parentDest
void PDFGenerator::addAnnotations( Poppler::Page * popplerPage, Okular::Page * page )
{
#ifdef HAVE_POPPLER_0_28
QSet<Poppler::Annotation::SubType> subtypes;
subtypes << Poppler::Annotation::AFileAttachment
<< Poppler::Annotation::ASound
<< Poppler::Annotation::AMovie
<< Poppler::Annotation::AWidget
<< Poppler::Annotation::AScreen
<< Poppler::Annotation::AText
<< Poppler::Annotation::ALine
<< Poppler::Annotation::AGeom
<< Poppler::Annotation::AHighlight
<< Poppler::Annotation::AInk
<< Poppler::Annotation::AStamp
<< Poppler::Annotation::ACaret;
QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations( subtypes );
#else
QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations();
#endif
foreach(Poppler::Annotation *a, popplerAnnotations)
{