Commit 0f8b2bab authored by Volker Krause's avatar Volker Krause
Browse files

Fix compatibility with Poppler 0.82

parent c72496f0
......@@ -62,17 +62,12 @@ if(TARGET Poppler::Core)
if (${Poppler_VERSION} VERSION_GREATER 0.68)
set(HAVE_POPPLER_0_69 ON)
endif()
set(CMAKE_REQUIRED_LIBRARIES Poppler::Core Qt5::Core)
check_cxx_source_compiles("
#include <goo/GooString.h>
#include <QString>
int main()
{
GooString s;
QString val = QString::fromUtf8(s.c_str());
return 0;
}
" HAVE_POPPLER_0_72)
if (${Poppler_VERSION} VERSION_GREATER 0.71)
set(HAVE_POPPLER_0_72 ON)
endif()
if (${Poppler_VERSION} VERSION_GREATER 0.81)
set(HAVE_POPPLER_0_82 ON)
endif()
endif()
if (TARGET ZXing::Core)
......
......@@ -24,6 +24,7 @@
#cmakedefine HAVE_POPPLER_0_58
#cmakedefine HAVE_POPPLER_0_69
#cmakedefine HAVE_POPPLER_0_72
#cmakedefine HAVE_POPPLER_0_82
#cmakedefine HAVE_ZXING
......
......@@ -30,7 +30,7 @@ PdfExtractorOutputDevice::PdfExtractorOutputDevice()
{
}
void PdfExtractorOutputDevice::drawImage(GfxState* state, Object* ref, Stream* str, int width, int height, GfxImageColorMap* colorMap, bool interpolate, int* maskColors, bool inlineImg)
void PdfExtractorOutputDevice::drawImage(GfxState* state, Object* ref, Stream* str, int width, int height, GfxImageColorMap* colorMap, bool interpolate, PopplerMaskColors* maskColors, bool inlineImg)
{
Q_UNUSED(str);
Q_UNUSED(interpolate);
......
......@@ -21,6 +21,7 @@
#include <config-kitinerary.h>
#include "pdfvectorpicture_p.h"
#include "popplertypes_p.h"
#ifdef HAVE_POPPLER
#include <TextOutputDev.h>
......@@ -43,7 +44,7 @@ public:
void finalize();
bool needNonText() override { return true; }
void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, int *maskColors, bool inlineImg) override;
void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, PopplerMaskColors *maskColors, bool inlineImg) override;
// operations used to detect vector barcodes
void saveState(GfxState *state) override;
......
/*
Copyright (C) 2019 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef KITINERARY_POPPLERTYPES_P_H
#define KITINERARY_POPPLERTYPES_P_H
#include <config-kitinerary.h>
#ifdef HAVE_POPPLER_0_82
using PopplerMaskColors = const int;
#else
using PopplerMaskColors = int;
#endif
#endif // KITINERARY_POPPLERTYPES_P_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment