]>
Commit | Line | Data |
---|---|---|
7f3f1a51 JB |
1 | From b7d63694985bbb1cf86eb71769feadb28ce68c17 Mon Sep 17 00:00:00 2001 |
2 | From: Sam James <sam@gentoo.org> | |
3 | Date: Fri, 2 Sep 2022 04:31:18 +0100 | |
4 | Subject: Fix build with Poppler 22.09.0 | |
5 | ||
6 | With Poppler 22.09.0, LO fails to build with: | |
7 | ``` | |
8 | /var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:682:36: error: too many arguments to function call, expected single argument 'start', have 3 arguments | |
9 | state->getLineDash(&dashArray, &arrayLen, &startOffset); | |
10 | ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~ | |
11 | /usr/include/poppler/GfxState.h:1506:32: note: 'getLineDash' declared here | |
12 | const std::vector<double> &getLineDash(double *start) | |
13 | ^ | |
14 | 1 error generated. | |
15 | ``` | |
16 | ||
17 | Poppler changed the getLineDash interface: | |
18 | ``` | |
19 | - void getLineDash(double **dash, int *length, double *start) | |
20 | + const std::vector<double> &getLineDash(double *start) | |
21 | ``` | |
22 | ||
23 | Signed-off-by: Sam James <sam@gentoo.org> | |
24 | Change-Id: I29e18f20d7650a7fcac1bc8ab4aaa04aaa2ab8fb | |
25 | Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139249 | |
26 | Tested-by: Jenkins | |
27 | Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> | |
28 | --- | |
29 | sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 9 ++++++++- | |
30 | 1 file changed, 8 insertions(+), 1 deletion(-) | |
31 | ||
32 | diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
33 | index f12478cb2f4d..3ad139b65fa3 100644 | |
34 | --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
35 | +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | |
36 | @@ -678,8 +678,15 @@ void PDFOutDev::updateLineDash(GfxState *state) | |
37 | return; | |
38 | assert(state); | |
39 | ||
40 | - double* dashArray; int arrayLen; double startOffset; | |
41 | + int arrayLen; double startOffset; | |
42 | +#if POPPLER_CHECK_VERSION(22, 9, 0) | |
43 | + const std::vector<double> &dash = state->getLineDash(&startOffset); | |
44 | + const double* dashArray = dash.data(); | |
45 | + arrayLen = dash.size(); | |
46 | +#else | |
47 | + double* dashArray; | |
48 | state->getLineDash(&dashArray, &arrayLen, &startOffset); | |
49 | +#endif | |
50 | ||
51 | printf( "updateLineDash" ); | |
52 | if( arrayLen && dashArray ) | |
53 | -- | |
54 | cgit v1.2.1 | |
55 |