Hello community, here is the log from the commit of package calligra for openSUSE:Factory checked in at 2020-01-23 15:53:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/calligra (Old) and /work/SRC/openSUSE:Factory/.calligra.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "calligra" Thu Jan 23 15:53:51 2020 rev:74 rq:766232 version:3.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/calligra/calligra.changes 2019-08-24 18:46:06.409759031 +0200 +++ /work/SRC/openSUSE:Factory/.calligra.new.26092/calligra.changes 2020-01-23 15:53:54.831062504 +0100 @@ -1,0 +2,7 @@ +Wed Jan 22 08:07:18 UTC 2020 - [email protected] + +- Add patches to fix build with the latest poppler versions: + * Fix-build-with-poppler-0.82.patch + * Fix-build-with-poppler-0.83.patch + +------------------------------------------------------------------- New: ---- Fix-build-with-poppler-0.82.patch Fix-build-with-poppler-0.83.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ calligra.spec ++++++ --- /var/tmp/diff_new_pack.Av6bQP/_old 2020-01-23 15:53:58.423064445 +0100 +++ /var/tmp/diff_new_pack.Av6bQP/_new 2020-01-23 15:53:58.423064445 +0100 @@ -38,6 +38,9 @@ Patch8: Fix-build-with-Qt-5_13.patch # PATCH-FIX-UPSTREAM Patch9: Guchar-to-unsigned-char.patch +# PATCH-FIX-UPSTREAM +Patch10: Fix-build-with-poppler-0.82.patch +Patch11: Fix-build-with-poppler-0.83.patch BuildRequires: Mesa-devel BuildRequires: OpenColorIO-devel BuildRequires: OpenEXR-devel ++++++ Fix-build-with-poppler-0.82.patch ++++++ >From bd580b5f3c935bcc4fa52e6413e714cdca9bf84f Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer <[email protected]> Date: Mon, 20 Jan 2020 13:18:07 +0100 Subject: [PATCH] Fix build with poppler 0.82 Differential Revision: https://phabricator.kde.org/D26050 --- filters/karbon/pdf/CMakeLists.txt | 4 ++++ filters/karbon/pdf/SvgOutputDev.cpp | 12 +++++++++++- filters/karbon/pdf/SvgOutputDev.h | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt index 8f462b7b597..945eebbe676 100644 --- a/filters/karbon/pdf/CMakeLists.txt +++ b/filters/karbon/pdf/CMakeLists.txt @@ -6,6 +6,10 @@ if(Poppler_VERSION VERSION_LESS "0.72.0") add_definitions("-DHAVE_POPPLER_PRE_0_72") endif() +if(Poppler_VERSION VERSION_LESS "0.82.0") + add_definitions("-DHAVE_POPPLER_PRE_0_82") +endif() + set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp ) add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS}) diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp index 6b5fd312f1a..3ebb2281bf3 100644 --- a/filters/karbon/pdf/SvgOutputDev.cpp +++ b/filters/karbon/pdf/SvgOutputDev.cpp @@ -417,7 +417,11 @@ void SvgOutputDev::drawString(GfxState * state, const GooString * s) #endif int len = s->getLength(); CharCode code; +#ifdef HAVE_POPPLER_PRE_0_82 Unicode *u = nullptr; +#else + const Unicode *u = nullptr; +#endif int uLen; double dx, dy, originX, originY; while (len > 0) { @@ -494,9 +498,15 @@ void SvgOutputDev::drawString(GfxState * state, const GooString * s) *d->body << "</text>" << endl; } -void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, +#ifdef HAVE_POPPLER_PRE_0_82 + void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool /*interpolate*/, int *maskColors, bool inlineImg) +#else + void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, + bool /*interpolate*/, const int *maskColors, bool inlineImg) +#endif { ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); imgStr->reset(); diff --git a/filters/karbon/pdf/SvgOutputDev.h b/filters/karbon/pdf/SvgOutputDev.h index 0667d9b2312..2b0ea41e30c 100644 --- a/filters/karbon/pdf/SvgOutputDev.h +++ b/filters/karbon/pdf/SvgOutputDev.h @@ -59,10 +59,18 @@ public: void drawString(GfxState * state, const GooString * s) override; #endif +#ifdef HAVE_POPPLER_PRE_0_82 // images void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, int *maskColors, bool inlineImg) override; +#else + // images + void drawImage(GfxState *state, Object *ref, Stream *str, + int width, int height, GfxImageColorMap *colorMap, + bool interpolate, const int *maskColors, bool inlineImg) override; +#endif + // styles void updateAll(GfxState *state) override; -- 2.16.4 ++++++ Fix-build-with-poppler-0.83.patch ++++++ >From 06d01dbba6f0f4779f9520d8c0f59412907aa550 Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer <[email protected]> Date: Wed, 22 Jan 2020 09:02:23 +0100 Subject: [PATCH] Fix build with poppler 0.83 --- filters/karbon/pdf/CMakeLists.txt | 4 ++++ filters/karbon/pdf/PdfImport.cpp | 16 ++++++++++++++++ filters/karbon/pdf/SvgOutputDev.cpp | 8 ++++++++ filters/karbon/pdf/SvgOutputDev.h | 4 ++++ 4 files changed, 32 insertions(+) diff --git a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt index 945eebbe676..94d4071da3d 100644 --- a/filters/karbon/pdf/CMakeLists.txt +++ b/filters/karbon/pdf/CMakeLists.txt @@ -10,6 +10,10 @@ if(Poppler_VERSION VERSION_LESS "0.82.0") add_definitions("-DHAVE_POPPLER_PRE_0_82") endif() +if(Poppler_VERSION VERSION_LESS "0.83.0") + add_definitions("-DHAVE_POPPLER_PRE_0_83") +endif() + set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp ) add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS}) diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp index f88719d4554..e62ea64a299 100644 --- a/filters/karbon/pdf/PdfImport.cpp +++ b/filters/karbon/pdf/PdfImport.cpp @@ -61,19 +61,31 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt } // read config file +#ifdef HAVE_POPPLER_PRE_0_83 globalParams = new GlobalParams(); +#else + globalParams = std::unique_ptr<GlobalParams>(new GlobalParams()); +#endif if (! globalParams) return KoFilter::NotImplemented; GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data()); PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0); if (! pdfDoc) { +#ifdef HAVE_POPPLER_PRE_0_83 delete globalParams; +#else + globalParams.reset(); +#endif return KoFilter::StupidError; } if (! pdfDoc->isOk()) { +#ifdef HAVE_POPPLER_PRE_0_83 delete globalParams; +#else + globalParams.reset(); +#endif delete pdfDoc; return KoFilter::StupidError; } @@ -100,8 +112,12 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt delete dev; delete pdfDoc; +#ifdef HAVE_POPPLER_PRE_0_83 delete globalParams; globalParams = 0; +#else + globalParams.reset(); +#endif return KoFilter::OK; } diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp index 3ebb2281bf3..0e3a3859e42 100644 --- a/filters/karbon/pdf/SvgOutputDev.cpp +++ b/filters/karbon/pdf/SvgOutputDev.cpp @@ -172,7 +172,11 @@ void SvgOutputDev::eoFill(GfxState *state) *d->body << "/>" << endl; } +#ifdef HAVE_POPPLER_PRE_0_83 QString SvgOutputDev::convertPath(GfxPath *path) +#else +QString SvgOutputDev::convertPath(const GfxPath *path) +#endif { if (! path) return QString(); @@ -180,7 +184,11 @@ QString SvgOutputDev::convertPath(GfxPath *path) QString output; for (int i = 0; i < path->getNumSubpaths(); ++i) { +#ifdef HAVE_POPPLER_PRE_0_83 GfxSubpath * subpath = path->getSubpath(i); +#else + const GfxSubpath * subpath = path->getSubpath(i); +#endif if (subpath->getNumPoints() > 0) { output += QString("M%1 %2").arg(subpath->getX(0)).arg(subpath->getY(0)); int j = 1; diff --git a/filters/karbon/pdf/SvgOutputDev.h b/filters/karbon/pdf/SvgOutputDev.h index 2b0ea41e30c..3ae014d4433 100644 --- a/filters/karbon/pdf/SvgOutputDev.h +++ b/filters/karbon/pdf/SvgOutputDev.h @@ -86,7 +86,11 @@ public: /// Dumps content to svg file void dumpContent(); private: +#ifdef HAVE_POPPLER_PRE_0_83 QString convertPath(GfxPath *path); +#else + QString convertPath(const GfxPath *path); +#endif QString convertMatrix(const QMatrix &matrix); QString convertMatrix(const double * matrix); QString printFill(); -- 2.16.4
