merge the checks for stuff in the development version of poppler in a HAVE_POPPLER_0_7

svn path=/trunk/KDE/kdegraphics/okular/; revision=773566
remotes/origin/KDE/4.1
Pino Toscano 18 years ago
parent 7aceeecb4d
commit ba59951fe0
  1. 19
      generators/poppler/CMakeLists.txt
  2. 7
      generators/poppler/config-okular-poppler.h.cmake
  3. 2
      generators/poppler/formfields.cpp
  4. 2
      generators/poppler/formfields.h
  5. 6
      generators/poppler/generator_pdf.cpp

@ -1,30 +1,17 @@
# check for Poppler::PSConverter::setOutputDevice() # check for Poppler::FormFieldButton as "0.7 check"
set(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIR} ${QT_INCLUDE_DIR}) set(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIR} ${QT_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${POPPLER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES ${POPPLER_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY})
check_cxx_source_compiles("
#include <poppler-qt4.h>
int main()
{
Poppler::Document * doc = Poppler::Document::load(\"foo\");
Poppler::PSConverter * psconv = doc->psConverter();
psconv->setOutputDevice( 0 );
return 0;
}
" POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE)
macro_bool_to_01(POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE _POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE)
check_cxx_source_compiles(" check_cxx_source_compiles("
#include <poppler-qt4.h> #include <poppler-qt4.h>
#include <poppler-form.h> #include <poppler-form.h>
int main() int main()
{ {
Poppler::FormFieldButton * button = 0; Poppler::FormFieldButton * button = 0;
button->buttonType();
return 0; return 0;
} }
" POPPLER_HAVE_FORMFIELDBUTTON) " HAVE_POPPLER_0_7)
macro_bool_to_01(POPPLER_HAVE_FORMFIELDBUTTON _POPPLER_HAVE_FORMFIELDBUTTON)
configure_file( configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake

@ -1,8 +1,5 @@
/* Defined if we have the 0.6 version of the Poppler library */ /* Defined if we have the 0.6 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_6 1 #cmakedefine HAVE_POPPLER_0_6 1
/* Defined if Poppler::PSConverter has setOutputDevice */ /* Defined if we have the 0.7 version of the Poppler library */
#define POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE ${_POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE} #cmakedefine HAVE_POPPLER_0_7 1
/* Defined if Poppler::FormFieldButton is available */
#define POPPLER_HAVE_FORMFIELDBUTTON ${_POPPLER_HAVE_FORMFIELDBUTTON}

@ -9,7 +9,7 @@
#include "formfields.h" #include "formfields.h"
#ifdef POPPLER_HAVE_FORMFIELDBUTTON #ifdef HAVE_POPPLER_0_7
PopplerFormFieldButton::PopplerFormFieldButton( Poppler::FormFieldButton * field ) PopplerFormFieldButton::PopplerFormFieldButton( Poppler::FormFieldButton * field )
: Okular::FormFieldButton(), m_field( field ) : Okular::FormFieldButton(), m_field( field )
{ {

@ -15,7 +15,7 @@
#include <config-okular-poppler.h> #include <config-okular-poppler.h>
#ifdef POPPLER_HAVE_FORMFIELDBUTTON #ifdef HAVE_POPPLER_0_7
class PopplerFormFieldButton : public Okular::FormFieldButton class PopplerFormFieldButton : public Okular::FormFieldButton
{ {
public: public:

@ -874,7 +874,7 @@ bool PDFGenerator::print( QPrinter& printer )
#ifdef HAVE_POPPLER_0_6 #ifdef HAVE_POPPLER_0_6
#if POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE #if HAVE_POPPLER_0_7
tf.setAutoRemove(false); tf.setAutoRemove(false);
#else #else
tf.close(); tf.close();
@ -890,7 +890,7 @@ bool PDFGenerator::print( QPrinter& printer )
Poppler::PSConverter *psConverter = pdfdoc->psConverter(); Poppler::PSConverter *psConverter = pdfdoc->psConverter();
#if POPPLER_HAVE_PSCONVERTER_SETOUTPUTDEVICE #if HAVE_POPPLER_0_7
psConverter->setOutputDevice(&tf); psConverter->setOutputDevice(&tf);
#else #else
psConverter->setOutputFileName(tempfilename); psConverter->setOutputFileName(tempfilename);
@ -1386,7 +1386,7 @@ void PDFGenerator::addFormFields( Poppler::Page * popplerPage, Okular::Page * pa
Okular::FormField * of = 0; Okular::FormField * of = 0;
switch ( f->type() ) switch ( f->type() )
{ {
#ifdef POPPLER_HAVE_FORMFIELDBUTTON #ifdef HAVE_POPPLER_0_7
case Poppler::FormField::FormButton: case Poppler::FormField::FormButton:
of = new PopplerFormFieldButton( static_cast<Poppler::FormFieldButton*>( f ) ); of = new PopplerFormFieldButton( static_cast<Poppler::FormFieldButton*>( f ) );
break; break;

Loading…
Cancel
Save