summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2019-10-26 14:11:35 +0200
committerAndras Timar <andras.timar@collabora.com>2021-04-20 21:41:13 +0200
commit28c0a7251c4d1fbf1a4099484f6f3c30eec2c54a (patch)
treee3c4b408d4560394d62db19eb071044396a629de
parent0dc3bfc3d4e41526bd7c45ab3eb550cb905ffe53 (diff)
Fix build with poppler-0.82
Change-Id: I3b6b3faea7986f3e5a6ae4790580d03bc9c955fc Reviewed-on: https://gerrit.libreoffice.org/81545 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 2eadd46ab81058087af95bdfc1fea28fcdb65998) Reviewed-on: https://gerrit.libreoffice.org/83363 Reviewed-by: Rasmus Thomsen <oss@cogitri.dev> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94380 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx25
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx16
2 files changed, 40 insertions, 1 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index ff57a1c49070..58ed91529a22 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -872,11 +872,20 @@ void PDFOutDev::eoClip(GfxState *state)
local offset of character (zero for horizontal writing mode). not
taken into account for output pos updates. Used for vertical writing.
*/
+
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+void PDFOutDev::drawChar(GfxState *state, double x, double y,
+ double dx, double dy,
+ double originX, double originY,
+ CharCode, int /*nBytes*/, const Unicode *u, int uLen)
+{
+#else
void PDFOutDev::drawChar(GfxState *state, double x, double y,
double dx, double dy,
double originX, double originY,
CharCode, int /*nBytes*/, Unicode *u, int uLen)
{
+#endif
assert(state);
if( u == nullptr )
@@ -988,11 +997,19 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str,
writeBinaryBuffer(aBuf);
}
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
+ int width, int height, GfxImageColorMap* colorMap,
+ poppler_bool /*interpolate*/,
+ const int* maskColors, poppler_bool /*inlineImg*/ )
+{
+#else
void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
int width, int height, GfxImageColorMap* colorMap,
poppler_bool /*interpolate*/,
int* maskColors, poppler_bool /*inlineImg*/ )
{
+#endif
if (m_bSkipImages)
return;
OutputBuffer aBuf; initBuf(aBuf);
@@ -1013,12 +1030,20 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str,
{
GfxRGB aMinRGB;
colorMap->getColorSpace()->getRGB(
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+ reinterpret_cast<const GfxColor*>(maskColors),
+#else
reinterpret_cast<GfxColor*>(maskColors),
+#endif
&aMinRGB );
GfxRGB aMaxRGB;
colorMap->getColorSpace()->getRGB(
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+ reinterpret_cast<const GfxColor*>(maskColors)+gfxColorMaxComps,
+#else
reinterpret_cast<GfxColor*>(maskColors)+gfxColorMaxComps,
+#endif
&aMaxRGB );
aMaskBuf.push_back( colToByte(aMinRGB.r) );
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index 726731e2fed4..6b52c233b21a 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -236,10 +236,17 @@ namespace pdfi
virtual void eoClip(GfxState *state) override;
//----- text drawing
+#if POPPLER_CHECK_VERSION(0, 82, 0)
+ virtual 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;
+#else
virtual 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;
+#endif
#if POPPLER_CHECK_VERSION(0, 64, 0)
virtual void drawString(GfxState *state, const GooString *s) override;
#else
@@ -252,10 +259,17 @@ namespace pdfi
int width, int height, poppler_bool invert,
poppler_bool interpolate,
poppler_bool inlineImg) override;
+#if POPPLER_CHECK_VERSION(0, 82, 0)
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
poppler_bool interpolate,
- int* maskColors, poppler_bool inlineImg) override;
+ const int* maskColors, poppler_bool inlineImg) override;
+#else
+ virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+ int width, int height, GfxImageColorMap *colorMap,
+ poppler_bool interpolate,
+ int* maskColors, poppler_bool inlineImg) override;
+#endif
virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
int width, int height,
GfxImageColorMap *colorMap,