mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-05 23:49:20 +00:00
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:
parent
c1ed635770
commit
19a216a275
|
@ -125,9 +125,21 @@ int main()
|
||||||
}
|
}
|
||||||
" HAVE_POPPLER_0_24)
|
" 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_INCLUDES)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES)
|
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")
|
set(popplerVersionMessage "0.24")
|
||||||
elseif (HAVE_POPPLER_0_22)
|
elseif (HAVE_POPPLER_0_22)
|
||||||
set(popplerVersionMessage "0.22")
|
set(popplerVersionMessage "0.22")
|
||||||
|
@ -137,9 +149,9 @@ int main()
|
||||||
set(popplerVersionMessage "0.16")
|
set(popplerVersionMessage "0.16")
|
||||||
elseif (HAVE_POPPLER_0_12_1)
|
elseif (HAVE_POPPLER_0_12_1)
|
||||||
set(popplerVersionMessage "0.12.1")
|
set(popplerVersionMessage "0.12.1")
|
||||||
else (HAVE_POPPLER_0_24)
|
else (HAVE_POPPLER_0_28)
|
||||||
set(popplerVersionMessage "0.5.4")
|
set(popplerVersionMessage "0.5.4")
|
||||||
endif (HAVE_POPPLER_0_24)
|
endif (HAVE_POPPLER_0_28)
|
||||||
if (NOT Poppler_FIND_QUIETLY)
|
if (NOT Poppler_FIND_QUIETLY)
|
||||||
message(STATUS "Found Poppler-Qt4: ${POPPLER_LIBRARY}, (>= ${popplerVersionMessage})")
|
message(STATUS "Found Poppler-Qt4: ${POPPLER_LIBRARY}, (>= ${popplerVersionMessage})")
|
||||||
endif (NOT Poppler_FIND_QUIETLY)
|
endif (NOT Poppler_FIND_QUIETLY)
|
||||||
|
|
|
@ -12,3 +12,6 @@
|
||||||
|
|
||||||
/* Defined if we have the 0.24 version of the Poppler library */
|
/* Defined if we have the 0.24 version of the Poppler library */
|
||||||
#cmakedefine HAVE_POPPLER_0_24 1
|
#cmakedefine HAVE_POPPLER_0_24 1
|
||||||
|
|
||||||
|
/* Defined if we have the 0.28 version of the Poppler library */
|
||||||
|
#cmakedefine HAVE_POPPLER_0_28 1
|
||||||
|
|
|
@ -1429,7 +1429,25 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, QDomNode * parentDest
|
||||||
|
|
||||||
void PDFGenerator::addAnnotations( Poppler::Page * popplerPage, Okular::Page * page )
|
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();
|
QList<Poppler::Annotation*> popplerAnnotations = popplerPage->annotations();
|
||||||
|
#endif
|
||||||
|
|
||||||
foreach(Poppler::Annotation *a, popplerAnnotations)
|
foreach(Poppler::Annotation *a, popplerAnnotations)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue