/ios/

>
summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
AgeCommit message (Collapse)Author
2025-01-08sdext: adapt xpdfwrapper to poppler 24.12Michael Stahl
Change-Id: Ia47edf2ac821e3ef5c40f7582253f894eac74060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179902 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-10-18tdf#148526 sdext,pdfimport: Write clipToStrokePathDr. David Alan Gilbert
'clipToStrokePath' is a variant of 'clip' it sets up a clip to a path that's been stroked with whatever width the current pen is. Now that we have all the rest of the code in, we can start using it. This fixes the white blobs on page 3 of tdf#148526 which are clipped radial fills. It has a separate problem with text corruption which this doesn't fix. It also fixes the geometry of the top left square in: https://gitlab.freedesktop.org/poppler/poppler/-/issues/178 (although it still has colour problems with that test case) Change-Id: Ibe2c56927b45d44e90cfa2934fc905034a50e9c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172927 Reviewed-by: David Gilbert <freedesktop@treblig.org> Tested-by: Jenkins
2024-09-27tdf#162887 sdext.pdfimport: Fix tilingPatternFill crashDr. David Alan Gilbert
regression from commit 8ac5f40b330c6cd248073b8686c05f566ecd7195 Author: Dr. David Alan Gilbert <dave@treblig.org> tdf#113050 sdext.pdfimport: Write the tiling pattern image The logo in the test file in tdf#159115 appears to be a tiling pattern fill where the fill is actually rendered text (instead of just an image) and this triggers splash to try and look at it's font code (even though I've already got EnableFreeType off) and that was initialised by startDoc which I'd failed to call. Call it. Note this doesn't fix tdf#159115, which originally had 4 copies of the logo, the current state is it has one unrendered white blob, but lets get rid of the crash first. Change-Id: I4e3f29cedcb8aefbb5adf96f696bf08457fbd58a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173139 Tested-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2024-04-04Drop a bit of redundancyMike Kaganski
POPPLER_CHECK_VERSION(0, 23, 0) implies POPPLER_CHECK_VERSION(0, 24, 0) Change-Id: I48f3763ef115719a3e3615623bfb40f7c79b8df4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165772 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-07sdext.pdfimport: Use std::unique_ptrDr. David Alan Gilbert
as per Noel's suggestion - this also ends up fixing some leaks as well. Change-Id: Ia6099afc1955c341256ec0de5a0f839c005d9b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164446 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-29tdf#113050 sdext.pdfimport: Flip bitmapDr. David Alan Gilbert
We need to flip the bitmap between the wrapper and LO, but there's no easy way to do this in a Poly image fill in LO, so do it as a simple bitmap flip in the wrapper. Change-Id: Ifd84d37926c21edf30654d3884be975849a6dca3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163563 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-29tdf#113050 sdext.pdfimport: Write the tiling pattern imageDr. David Alan Gilbert
Render the tile down to a common format using Splash and write it to the stream. Change-Id: Iccc451d1a02ed2ad77538883ab3fe5542fc633e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-29tdf#113050 sdext.pdfimport: Write the tiling pattern headerDr. David Alan Gilbert
Add the 'tilingPatternFill' hook to our output device, but don't enable it yet; we can do that at the end of the series. Change-Id: Id52b023c3025f5addce1ab09663da9b8bd8a75e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-13Fix obscure xpdfimport crash on missing fontsThorsten Behrens
Invert logic, such that the case WMode == 0 and no font set now run the former else branch. Happened here for an obscure pdf I was missing some fonts for. Change-Id: I2825c914a04f6a95d459eeeffb8091ed8f1819dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162029 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-09-13Fix build with Poppler 22.09.0Sam James
With Poppler 22.09.0, LO fails to build with: ``` /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 state->getLineDash(&dashArray, &arrayLen, &startOffset); ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/poppler/GfxState.h:1506:32: note: 'getLineDash' declared here const std::vector<double> &getLineDash(double *start) ^ 1 error generated. ``` Poppler changed the getLineDash interface: ``` - void getLineDash(double **dash, int *length, double *start) + const std::vector<double> &getLineDash(double *start) ``` Signed-off-by: Sam James <sam@gentoo.org> Change-Id: I29e18f20d7650a7fcac1bc8ab4aaa04aaa2ab8fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139249 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-06-24Follow-up for Poppler 22.06 updateNathan Pratta Teodosio
Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136342 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-06-23Update for Poppler 22.06Nathan Pratta Teodosio
Change-Id: I8ee9f1a53cc4389e6a4d44e9765b478b5edfffd3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136261 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-11sdext.pdfimport tdf#78427: Add support for more Font Weight featuresKevin Suo
...e.g. Thin, Extra-Light, Light, Semi-Bold, Bold, Extra-Bold and Black. Previously the xpdfimport code passes the isBold value which is bool value. sdext.pdfimport accepted this value from the xpdfimport output and check whether a font is bold or not. However, there are many other FontWeight features more than a "bold". This patch changes the isBold to the GfxFont::Weight type, and changed the sdext.pdfimport isBold bool type (in FontAttributes) to an OUString fontWeight. The value for the fontWeight is set according to the GfxFont::Weight passed by xpdfimport, and then this fontWeight is passed to the ODF xml generation stage and used there directly. Now the Semibold and Light (as shown in the unittest file) can be currectly handled. However, for other weights the parseFontFamilyName still need to be updated, but before doing that I plan to refector this function as the current logic is very difficult for maintennance. Change-Id: If2ce5f0f41c83843d8a6aeb30134b3faf99ba877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123339 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-12allow build with poppler <= 0.71Rico Tzschichholz
Change-Id: I359c8259ae402f9f22be392c4ab4a23d31a17b4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121937 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I0a9b238c0ba551b330bee7b89eb6cd48fad1b265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121488 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-20allow build with poppler <= 0.82Caolán McNamara
Change-Id: Ia062a788fec9c67c18382c2ff5f4b4df35bd17d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120771 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-18loplugin:constparamsNoel Grandin
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-27GooString::append(const std::string&) is new in poppler 0.83.0Luboš Luňák
Change-Id: Ib3324c393c195526160eddbdfc83a688e6f66dbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119534 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-07-26sdext.pdfimport: Restore to read font file for the determination...Kevin Suo
of font attributes, as suggested by Mike Kaganski in https://gerrit.libreoffice.org/c/core/+/118977. This partially reverts da59686672fd2bc98f8cb28d5f04dc978b50ac13 but did some modification of the previous code with some explanationary comments. Change-Id: I224d9e717bf374a90f4834cbd9e11bf1138b41ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-18poppler 0.73 doesn't have GooString::append(const std::string&)Caolán McNamara
don't know what version is appeared in Change-Id: Ia1fff05aa58990e631d63a2e694be47a4b74e24c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119126 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-16restore compatibility with older popplersKevin Suo
with poppler 20.09: /home/rene/LibreOffice/git/libreoffice-7-2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'int pdfi::PDFOutDev::parseFont(long long int, GfxFont*, GfxState*) const': /home/rene/LibreOffice/git/libreoffice-7-2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:438:39: error: 'class GfxFont' has no member named 'getNameWithoutSubsetTag' https://www.google.com/search?q=getNameWithoutSubsetTag&oq=getNameWithoutSubsetTag&aqs=chrome..69i57.784j0j7&sourceid=chrome&ie=UTF-8 suggests it was added in 20.12 Change-Id: I4eacd2d740cb689ff9b3c6cab59376e01b1ba162 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118977 Tested-by: René Engelhard <rene@debian.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-12tdf#78427 sdext.pdfimport: No need to read a font file for the purpose of...Kevin Suo
...determining the bold/italic/underline etc. The purpose for reading a font file is that in case the font attributes determined by the xpdfimport process is not enough, then we use the lo core font classes which read in the font file and then determine whether it is bold, italic etc. However, while this works in some cases, it does not work in many cases when the font file was actually a subset and a toUnicode map is followed in the PDF, see tdf#78427. In addition, in case the information collected from the xpdfimport process is enough, there is no need to read the font file. This commit removes the read of font file part. Also, this commit uses gfxFont->getNameWithoutSubsetTag() to get the font name with the subset tags removed, thus simplified the code in wrapper.cxx while also improves performace as the remove of subset tags is only run when the font is a subset (the previous code did this for all the font names). Change-Id: I94c1ad8e743abfab81cf0a46da178d4d8b212427 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118733 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2020-06-18tdf#131353: Fix build with poppler 0.86.0Martin Whitaker
Change-Id: I89b4635a6a3e3a5522172d6f4c3f14e6c14994b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93789 Tested-by: René Engelhard <rene@debian.org> Tested-by: Jenkins Reviewed-by: Tomáš Chvátal <tchvatal@suse.com>
2019-12-04Fix build with poppler-0.83Martin Milata
Change-Id: I7a3684932b8f9c403a3368b42fa4d8039c67f1a9 Reviewed-on: https://gerrit.libreoffice.org/84384 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-06loplugin:indentation find broken if statementsNoel Grandin
so I don't read the "then" block as being a sequential statements Change-Id: Ib2004acd3518bd4ebd2246f02a26c2c0a8bbab4c Reviewed-on: https://gerrit.libreoffice.org/82069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-28Fix build with poppler-0.82Rasmus Thomsen
Change-Id: I3b6b3faea7986f3e5a6ae4790580d03bc9c955fc Reviewed-on: https://gerrit.libreoffice.org/81545 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-05-22New loplugin:dataStephan Bergmann
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-12loplugin:flatten in sdextNoel Grandin
Change-Id: I5a7c2d38ef2e4af54316becd807bffab83d402d0 Reviewed-on: https://gerrit.libreoffice.org/67715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-15sdext: fix build with poppler 0.73Michael Stahl
... which has removed Guchar, Gushort, Guint, Gulong... Change-Id: Ia54ad378031f167f6779f6ffe574b85c1e72f26d Reviewed-on: https://gerrit.libreoffice.org/66305 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-08Fix build with poppler-0.72Andreas Sturmlechner
Change-Id: I0664d1b39e97b7555c0a3cba442db52b84f37134 Reviewed-on: https://gerrit.libreoffice.org/65960 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-12-10Fix build with poppler 0.71Aleksei Nikiforov
Change-Id: I470ece9dc4766e10e1ccb5e99b25a8d8cc4cbf38 Reviewed-on: https://gerrit.libreoffice.org/63860 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-20poppler dropped GBool since 0.71Mike Kaganski
See https://lists.freedesktop.org/archives/libreoffice/2018-November/081410.html Change-Id: I258e08894486a925bed50a3a4232b6e805af6784 Reviewed-on: https://gerrit.libreoffice.org/63625 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-23remove old poppler compat codeNoel Grandin
since we require poppler >= 0.12.0 Change-Id: Ie698ecbe776d12ef21ba8f12ac4dfa0575ed467b Reviewed-on: https://gerrit.libreoffice.org/62223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-09Extend loplugin:redundantinline to catch inline functions w/o external linkageStephan Bergmann
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-24fix build with poppler 0.64Rene Engelhard
GooString became const... Change-Id: Icc95be2e8603a4e22c6a9ac2008986bacd0bfba5
2018-04-20loplugin:constantparamNoel Grandin
Change-Id: Ia58d8950b3b9e48bbe9f075b9fe1eed62d9abf0d Reviewed-on: https://gerrit.libreoffice.org/53188 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02sdext: MSVC: pragma warning: make more specific, remove obsoleteMike Kaganski
Change-Id: I317b952c27fd052d4f19aa0dfc4ee9ce1e4705ad Reviewed-on: https://gerrit.libreoffice.org/49046 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-01-12More loplugin:cstylecast: sdextStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: Ie9eca6a78912a62f5a46ecacb1da052621c79ea4
2018-01-08Allow building with poppler-0.62Dominique Leuenberger
Change-Id: Ia627f1628a67dd8ece7d9318639d9ccd06b89765 Reviewed-on: https://gerrit.libreoffice.org/47460 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-12-07loplugin:constparamsNoel Grandin
Change-Id: Ia322ecf8f80b28c58ec33d17ca9607401a92534b Reviewed-on: https://gerrit.libreoffice.org/45959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31loplugin:constantparam in sdNoel Grandin
Change-Id: I1c5e5a26d343ac3aa244d7b053f2ec6922edbb21 Reviewed-on: https://gerrit.libreoffice.org/44085 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-23loplugin:includeform: sdextStephan Bergmann
Change-Id: Ieb9641b9846ecfed8d1a022a48defe7644405690