]>
Commit | Line | Data |
---|---|---|
62714dd2 JR |
1 | From 2eadd46ab81058087af95bdfc1fea28fcdb65998 Mon Sep 17 00:00:00 2001 |
2 | From: Rasmus Thomsen <oss@cogitri.dev> | |
3 | Date: Sat, 26 Oct 2019 14:11:35 +0200 | |
4 | Subject: [PATCH] Fix build with poppler-0.82 | |
5 | ||
6 | Change-Id: I3b6b3faea7986f3e5a6ae4790580d03bc9c955fc | |
7 | Reviewed-on: https://gerrit.libreoffice.org/81545 | |
8 | Tested-by: Jenkins | |
9 | Reviewed-by: Michael Stahl <michael.stahl@cib.de> | |
10 | --- | |
11 | .../pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 25 +++++++++++++++++++ | |
12 | .../pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | 16 +++++++++++- | |
13 | 2 files changed, 40 insertions(+), 1 deletion(-) | |
14 | ||
15 | diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
16 | index ce32a4139c45..3ae3bdc503e0 100644 | |
17 | --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
18 | +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
19 | @@ -863,11 +863,20 @@ void PDFOutDev::eoClip(GfxState *state) | |
20 | local offset of character (zero for horizontal writing mode). not | |
21 | taken into account for output pos updates. Used for vertical writing. | |
22 | */ | |
23 | + | |
24 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
25 | +void PDFOutDev::drawChar(GfxState *state, double x, double y, | |
26 | + double dx, double dy, | |
27 | + double originX, double originY, | |
28 | + CharCode, int /*nBytes*/, const Unicode *u, int uLen) | |
29 | +{ | |
30 | +#else | |
31 | void PDFOutDev::drawChar(GfxState *state, double x, double y, | |
32 | double dx, double dy, | |
33 | double originX, double originY, | |
34 | CharCode, int /*nBytes*/, Unicode *u, int uLen) | |
35 | { | |
36 | +#endif | |
37 | assert(state); | |
38 | ||
39 | if( u == nullptr ) | |
40 | @@ -979,11 +988,19 @@ void PDFOutDev::drawImageMask(GfxState* pState, Object*, Stream* str, | |
41 | writeBinaryBuffer(aBuf); | |
42 | } | |
43 | ||
44 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
45 | +void PDFOutDev::drawImage(GfxState*, Object*, Stream* str, | |
46 | + int width, int height, GfxImageColorMap* colorMap, | |
47 | + poppler_bool /*interpolate*/, | |
48 | + const int* maskColors, poppler_bool /*inlineImg*/ ) | |
49 | +{ | |
50 | +#else | |
51 | void PDFOutDev::drawImage(GfxState*, Object*, Stream* str, | |
52 | int width, int height, GfxImageColorMap* colorMap, | |
53 | poppler_bool /*interpolate*/, | |
54 | int* maskColors, poppler_bool /*inlineImg*/ ) | |
55 | { | |
56 | +#endif | |
57 | if (m_bSkipImages) | |
58 | return; | |
59 | OutputBuffer aBuf; initBuf(aBuf); | |
60 | @@ -1004,12 +1021,20 @@ void PDFOutDev::drawImage(GfxState*, Object*, Stream* str, | |
61 | { | |
62 | GfxRGB aMinRGB; | |
63 | colorMap->getColorSpace()->getRGB( | |
64 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
65 | + reinterpret_cast<const GfxColor*>(maskColors), | |
66 | +#else | |
67 | reinterpret_cast<GfxColor*>(maskColors), | |
68 | +#endif | |
69 | &aMinRGB ); | |
70 | ||
71 | GfxRGB aMaxRGB; | |
72 | colorMap->getColorSpace()->getRGB( | |
73 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
74 | + reinterpret_cast<const GfxColor*>(maskColors)+gfxColorMaxComps, | |
75 | +#else | |
76 | reinterpret_cast<GfxColor*>(maskColors)+gfxColorMaxComps, | |
77 | +#endif | |
78 | &aMaxRGB ); | |
79 | ||
80 | aMaskBuf.push_back( colToByte(aMinRGB.r) ); | |
81 | diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | |
82 | index 1a0c3f0caad1..02f6b59f6f15 100644 | |
83 | --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | |
84 | +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx | |
85 | @@ -232,10 +232,17 @@ namespace pdfi | |
86 | virtual void eoClip(GfxState *state) override; | |
87 | ||
88 | //----- text drawing | |
89 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
90 | + virtual void drawChar(GfxState *state, double x, double y, | |
91 | + double dx, double dy, | |
92 | + double originX, double originY, | |
93 | + CharCode code, int nBytes, const Unicode *u, int uLen) override; | |
94 | +#else | |
95 | virtual void drawChar(GfxState *state, double x, double y, | |
96 | double dx, double dy, | |
97 | double originX, double originY, | |
98 | CharCode code, int nBytes, Unicode *u, int uLen) override; | |
99 | +#endif | |
100 | #if POPPLER_CHECK_VERSION(0, 64, 0) | |
101 | virtual void drawString(GfxState *state, const GooString *s) override; | |
102 | #else | |
103 | @@ -248,10 +255,17 @@ namespace pdfi | |
104 | int width, int height, poppler_bool invert, | |
105 | poppler_bool interpolate, | |
106 | poppler_bool inlineImg) override; | |
107 | +#if POPPLER_CHECK_VERSION(0, 82, 0) | |
108 | virtual void drawImage(GfxState *state, Object *ref, Stream *str, | |
109 | int width, int height, GfxImageColorMap *colorMap, | |
110 | poppler_bool interpolate, | |
111 | - int* maskColors, poppler_bool inlineImg) override; | |
112 | + const int* maskColors, poppler_bool inlineImg) override; | |
113 | +#else | |
114 | + virtual void drawImage(GfxState *state, Object *ref, Stream *str, | |
115 | + int width, int height, GfxImageColorMap *colorMap, | |
116 | + poppler_bool interpolate, | |
117 | + int* maskColors, poppler_bool inlineImg) override; | |
118 | +#endif | |
119 | virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, | |
120 | int width, int height, | |
121 | GfxImageColorMap *colorMap, |