From fca3858b15aa76dc05691cfa7b5b3649264b7786 Mon Sep 17 00:00:00 2001 From: Jean Ghali Date: Tue, 29 Oct 2019 01:55:42 +0000 Subject: [PATCH] Use same mechanism as with previous poppler versions to support change of constness in function signatures git-svn-id: svn://scribus.net/trunk/Scribus@23289 11d20701-8431-0410-a711-e3c959e3b870 --- scribus/plugins/import/pdf/importpdfconfig.h | 6 +++++ scribus/plugins/import/pdf/slaoutput.cpp | 26 ++++++-------------- scribus/plugins/import/pdf/slaoutput.h | 15 +++-------- 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h index 2a13b0d109..9913ee382c 100644 --- a/scribus/plugins/import/pdf/importpdfconfig.h +++ b/scribus/plugins/import/pdf/importpdfconfig.h @@ -52,4 +52,10 @@ for which a new license (GPL+exception) is in place. #define POPPLER_REF #endif +#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 82, 0) +#define POPPLER_CONST_082 const +#else +#define POPPLER_CONST_082 +#endif + #endif diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp index f3d6446880..bb7b184272 100644 --- a/scribus/plugins/import/pdf/slaoutput.cpp +++ b/scribus/plugins/import/pdf/slaoutput.cpp @@ -1606,7 +1606,7 @@ void SlaOutputDev::stroke(GfxState *state) ite->PoLine = out.copy(); ite->ClipEdited = true; ite->FrameType = 3; - ite->setWidthHeight(wh.x(),wh.y()); + ite->setWidthHeight(wh.x(), wh.y()); m_doc->adjustItemSize(ite); if (m_Elements->count() != 0) { @@ -2471,7 +2471,7 @@ void SlaOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int out.translate(-ite->xPos(), -ite->yPos()); ite->PoLine = out.copy(); FPoint wh = getMaxClipF(&ite->PoLine); - ite->setWidthHeight(wh.x(),wh.y()); + ite->setWidthHeight(wh.x(), wh.y()); ite->setTextFlowMode(PageItem::TextFlowDisabled); ite->ScaleType = true; m_doc->adjustItemSize(ite); @@ -2613,7 +2613,7 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str out.translate(-ite->xPos(), -ite->yPos()); ite->PoLine = out.copy(); FPoint wh = getMaxClipF(&ite->PoLine); - ite->setWidthHeight(wh.x(),wh.y()); + ite->setWidthHeight(wh.x(), wh.y()); ite->setTextFlowMode(PageItem::TextFlowDisabled); ite->ScaleType = true; m_doc->adjustItemSize(ite); @@ -2762,7 +2762,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i out.translate(-ite->xPos(), -ite->yPos()); ite->PoLine = out.copy(); FPoint wh = getMaxClipF(&ite->PoLine); - ite->setWidthHeight(wh.x(),wh.y()); + ite->setWidthHeight(wh.x(), wh.y()); ite->setTextFlowMode(PageItem::TextFlowDisabled); ite->ScaleType = true; m_doc->adjustItemSize(ite); @@ -2784,11 +2784,7 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i delete[] mbuffer; } -#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0) -void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int* maskColors, GBool inlineImg) -#else -void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int* maskColors, GBool inlineImg) -#endif +void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int* maskColors, GBool inlineImg) { ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits()); // qDebug() << "Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors; @@ -3369,11 +3365,7 @@ void SlaOutputDev::updateFont(GfxState *state) fontsrc->unref(); } -#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0) -void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode *u, int uLen) -#else -void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen) -#endif +void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, POPPLER_CONST_082 Unicode *u, int uLen) { double x1, y1, x2, y2; int render; @@ -3460,11 +3452,7 @@ void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub } } -#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0) -GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen) -#else -GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen) -#endif +GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen) { // qDebug() << "beginType3Char"; GfxFont *gfxFont; diff --git a/scribus/plugins/import/pdf/slaoutput.h b/scribus/plugins/import/pdf/slaoutput.h index b5905184e5..14a590d55e 100644 --- a/scribus/plugins/import/pdf/slaoutput.h +++ b/scribus/plugins/import/pdf/slaoutput.h @@ -229,11 +229,7 @@ class SlaOutputDev : public OutputDev //----- image drawing void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override; -#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0) - void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg) override; -#else - void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, const int *maskColors, GBool inlineImg) override; -#endif + void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int *maskColors, GBool inlineImg) override; void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, @@ -265,13 +261,8 @@ class SlaOutputDev : public OutputDev //----- text drawing void beginTextObject(GfxState *state) override; void endTextObject(GfxState *state) override; -#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 82, 0) - void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, Unicode * /*u*/, int /*uLen*/) override; - GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, Unicode * /*u*/, int /*uLen*/) override; -#else - void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, const Unicode * /*u*/, int /*uLen*/) override; - GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, const Unicode * /*u*/, int /*uLen*/) override; -#endif + void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override; + GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override; void endType3Char(GfxState * /*state*/) override; void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override; void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;