diff --git a/cmake/modules/FindPoppler.cmake b/cmake/modules/FindPoppler.cmake index 6389a625d..10e1ec71c 100644 --- a/cmake/modules/FindPoppler.cmake +++ b/cmake/modules/FindPoppler.cmake @@ -135,9 +135,20 @@ int main() } " HAVE_POPPLER_0_28) +check_cxx_source_compiles(" +#include +int main() +{ + Poppler::PageTransition *p = 0; + return p->durationReal(); +} +" HAVE_POPPLER_0_37) + set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - if (HAVE_POPPLER_0_28) + if (HAVE_POPPLER_0_37) + set(popplerVersionMessage "0.37") + elseif (HAVE_POPPLER_0_28) set(popplerVersionMessage "0.28") elseif (HAVE_POPPLER_0_24) set(popplerVersionMessage "0.24") diff --git a/core/pagetransition.cpp b/core/pagetransition.cpp index d57106dda..5745221ac 100644 --- a/core/pagetransition.cpp +++ b/core/pagetransition.cpp @@ -29,7 +29,7 @@ class PageTransition::Private } Type m_type; - int m_duration; + double m_duration; Alignment m_alignment; Direction m_direction; int m_angle; @@ -67,7 +67,7 @@ PageTransition::Type PageTransition::type() const return d->m_type; } -int PageTransition::duration() const +double PageTransition::duration() const { return d->m_duration; } @@ -102,7 +102,7 @@ void PageTransition::setType( Type type ) d->m_type = type; } -void PageTransition::setDuration( int duration ) +void PageTransition::setDuration( double duration ) { d->m_duration = duration; } diff --git a/core/pagetransition.h b/core/pagetransition.h index 4b6e7f9fe..f6935286a 100644 --- a/core/pagetransition.h +++ b/core/pagetransition.h @@ -86,7 +86,7 @@ class OKULAR_EXPORT PageTransition /** * Returns the duration of the transition in seconds. */ - int duration() const; + double duration() const; /** * Returns the alignment of the transition. @@ -121,7 +121,7 @@ class OKULAR_EXPORT PageTransition /** * Sets the @p duration in seconds for the transition. */ - void setDuration( int duration ); + void setDuration( double duration ); /** * Sets the @p alignment of the transition (@ref Alignment). diff --git a/generators/poppler/config-okular-poppler.h.cmake b/generators/poppler/config-okular-poppler.h.cmake index 1e8ff9ed3..c3e9b1865 100644 --- a/generators/poppler/config-okular-poppler.h.cmake +++ b/generators/poppler/config-okular-poppler.h.cmake @@ -15,3 +15,6 @@ /* Defined if we have the 0.28 version of the Poppler library */ #cmakedefine HAVE_POPPLER_0_28 1 + +/* Defined if we have the 0.37 version of the Poppler library */ +#cmakedefine HAVE_POPPLER_0_37 1 diff --git a/generators/poppler/generator_pdf.cpp b/generators/poppler/generator_pdf.cpp index ca5229654..a65487af0 100644 --- a/generators/poppler/generator_pdf.cpp +++ b/generators/poppler/generator_pdf.cpp @@ -1515,7 +1515,11 @@ void PDFGenerator::addTransition( Poppler::Page * pdfPage, Okular::Page * page ) break; } +#ifdef HAVE_POPPLER_0_37 + transition->setDuration( pdfTransition->durationReal() ); +#else transition->setDuration( pdfTransition->duration() ); +#endif switch ( pdfTransition->alignment() ) { case Poppler::PageTransition::Horizontal: