Remove poppler 0.79 ifdefs since we require 0.86 now

remotes/origin/work/aacid/shorcutslost_2008
Albert Astals Cid 6 years ago
parent 4d12c257b2
commit 6b08af754f
  1. 6
      autotests/kjsfunctionstest.cpp
  2. 12
      generators/poppler/CMakeLists.txt
  3. 3
      generators/poppler/config-okular-poppler.h.cmake
  4. 30
      generators/poppler/formfields.cpp
  5. 2
      generators/poppler/formfields.h

@ -84,7 +84,6 @@ class KJSFunctionsTest : public QObject
Q_OBJECT
private slots:
#ifdef HAVE_POPPLER_0_79
void initTestCase();
void testNthFieldName();
void testDisplay();
@ -99,11 +98,8 @@ private slots:
private:
Okular::Document *m_document;
QMap<QString, Okular::FormField *> m_fields;
#endif
};
#ifdef HAVE_POPPLER_0_79
void KJSFunctionsTest::initTestCase()
{
Okular::SettingsCore::instance(QStringLiteral("kjsfunctionstest"));
@ -359,7 +355,5 @@ void KJSFunctionsTest::cleanupTestCase()
delete m_document;
}
#endif
QTEST_MAIN(KJSFunctionsTest)
#include "kjsfunctionstest.moc"

@ -5,18 +5,6 @@ add_subdirectory( conf )
set(CMAKE_REQUIRED_LIBRARIES Poppler::Qt5 Qt5::Core Qt5::Gui)
check_cxx_source_compiles("
#include <poppler-form.h>
#include <poppler-qt5.h>
int main()
{
Poppler::FormFieldIcon icon(nullptr);
Poppler::FormFieldButton *button = nullptr;
button->setIcon( icon );
return 0;
}
" HAVE_POPPLER_0_79)
check_cxx_source_compiles("
#include <poppler-qt5.h>
int main()

@ -1,6 +1,3 @@
/* Defined if we have the 0.79 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_79 1
/* Defined if we have the 0.80 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_80 1

@ -92,20 +92,12 @@ void PopplerFormFieldButton::setVisible(bool value)
bool PopplerFormFieldButton::isPrintable() const
{
#ifdef HAVE_POPPLER_0_79
return m_field->isPrintable();
#else
return true;
#endif
}
void PopplerFormFieldButton::setPrintable(bool value)
{
#ifdef HAVE_POPPLER_0_79
m_field->setPrintable(value);
#else
Q_UNUSED(value);
#endif
}
Okular::FormFieldButton::ButtonType PopplerFormFieldButton::buttonType() const
@ -141,23 +133,17 @@ QList<int> PopplerFormFieldButton::siblings() const
return m_field->siblings();
}
#ifdef HAVE_POPPLER_0_79
Poppler::FormFieldIcon PopplerFormFieldButton::icon() const
{
return m_field->icon();
}
#endif
void PopplerFormFieldButton::setIcon(Okular::FormField *field)
{
#ifdef HAVE_POPPLER_0_79
if (field->type() == Okular::FormField::FormButton) {
PopplerFormFieldButton *button = static_cast<PopplerFormFieldButton *>(field);
m_field->setIcon(button->icon());
}
#else
Q_UNUSED(field);
#endif
}
PopplerFormFieldText::PopplerFormFieldText(std::unique_ptr<Poppler::FormFieldText> field)
@ -216,20 +202,12 @@ void PopplerFormFieldText::setVisible(bool value)
bool PopplerFormFieldText::isPrintable() const
{
#ifdef HAVE_POPPLER_0_79
return m_field->isPrintable();
#else
return true;
#endif
}
void PopplerFormFieldText::setPrintable(bool value)
{
#ifdef HAVE_POPPLER_0_79
m_field->setPrintable(value);
#else
Q_UNUSED(value);
#endif
}
Okular::FormFieldText::TextType PopplerFormFieldText::textType() const
@ -354,20 +332,12 @@ void PopplerFormFieldChoice::setVisible(bool value)
bool PopplerFormFieldChoice::isPrintable() const
{
#ifdef HAVE_POPPLER_0_79
return m_field->isPrintable();
#else
return true;
#endif
}
void PopplerFormFieldChoice::setPrintable(bool value)
{
#ifdef HAVE_POPPLER_0_79
m_field->setPrintable(value);
#else
Q_UNUSED(value);
#endif
}
Okular::FormFieldChoice::ChoiceType PopplerFormFieldChoice::choiceType() const

@ -40,14 +40,12 @@ public:
void setState(bool state) override;
QList<int> siblings() const override;
void setIcon(Okular::FormField *field) override;
#ifdef HAVE_POPPLER_0_79
/*
* Supported only in newer versions of Poppler library.
*
* @since 1.9
*/
Poppler::FormFieldIcon icon() const;
#endif
private:
std::unique_ptr<Poppler::FormFieldButton> m_field;

Loading…
Cancel
Save