summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfwriter_impl.cxx
AgeCommit message (Collapse)Author
2021-03-13tdf#140606 make PDF parsing more lenient and prevent a crashTomaž Vajngerl
If the external document can't be opened, it tried to continue with the export anyway, which eventually lead to a crash. This is fixed by handling this situation and prevent a crash, however the part of the document in this case isn't exported. The document couldn't be opened because of a parsing error - there was a unexpected null character instead of a whitespace, which made the parser panic. Fix this by making the parser more lenient in such a situation when there is an unexpected null and try to continue parsing. Bug document seems to be created with a buggy PDF writer, but other PDF readers don't complain when parsing the document so it looks to be a valid. qpdf --check doesn't complain either. Added a test that checks a document with a null parses. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111820 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 2c1ed5a5dad827cde032f27a4348e81be15889bc) Change-Id: I61eb281e821ccd195ef006d778556e25d1c7f5e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112418 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-10-28pdf: deduplicate resources when copying from external PDF streamTomaž Vajngerl
When using external PDF stream/data (from PDF graphic objects), make sure to copy the content of external PDF resources (fonts, bitmaps, forms) only one time (by sharing the map between calls) and every other use, just use the reference to the objects. Change-Id: Ibaa632c8f74806eb195e69404551db6fd077a986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104935 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-20tdf#50879 PDF export: ensure only built-in fonts are used for formsMiklos Vajna
Alternative would be to embed the whole font, which is unusual: PDF typically just embeds the used subset. (cherry picked from commit 6294ecd7b4da38de98b24ddfb9f201cef98c1f41) [ Backport is missing the testcase, pdfium on this branch is too old. ] Change-Id: Ic0b7e121b3ae38804c1a396ea36104ebcc0b9588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99049 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-10pdfwriter: nDelta is a signed number appendPdfTimeDateJulien Nabet
includes cid#1465240: DEADCODE See https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf 7.9.4 Dates "O shall be the relationship of local time to Universal Time (UT), and shall be denoted by one of the characters PLUS SIGN (U+002B) (+), HYPHEN-MINUS (U+002D) (-), or LATIN CAPITAL LETTER Z (U+005A) (Z) (see below) ... A PLUS SIGN as the value of the O field signifies that local time is later than UT, a HYPHEN-MINUS signifies that local time is earlier than UT, and the LATIN CAPITAL LETTER Z signifies that local time is equal to UT. If no UT information is specified, the relationship of the specified time to UT shall be considered to be GMT. Regardless of whether the time zone is specified, the rest of the date shall be specified in local time." Change-Id: If9ce87752afd00866a426a1196fafa7e0942270e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98454 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-29pdf: fix text annotation (note) modification dateTomaž Vajngerl
The modification date wasn't encolsed in brackets, which is required for the modification date. Change-Id: Icf91516436b095a8577d3ab10b2a708d10d58cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97330 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 09c01a8d6f5dc072991450d215558555152764a8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97447 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-29pdf export: add support for modification time/date in annotationsTomaž Vajngerl
Previously the modification date was written to the annotation "title" as string, together with the username. This is however not neccessary as PDF supports the modification date perfectly fine. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96766 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 235c54e115b66c880d3da0b8018f8ef29d20bc42) Change-Id: I6f55e4fe63d9c3c81ec557f6cfd3387f011e67c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97444 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-29pdf export: support pop-up annotation for notes / commentsTomaž Vajngerl
This changes pdf export for annotation, so the comments are exported as "text" annotation with an child "pop-up" annotations. This seems to be more common what PDF readers do (even when text annotation only should be enough). Also changes the test, so that it now works as expected. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96765 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 51d529c18dadb05754590a01ce4c1f06f41cf412) Change-Id: I95bc12939f490effe7759dad54e136c44e44a2f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97443 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-29pdf: clean-up PDFWriterImpl::createNoteTomaž Vajngerl
Change-Id: Ie2d50b92d448864e9e20098060b0e42f747f1638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96761 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 387a35fae2a539706f605f052322c1a384b07ce1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97442 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-06-29sd signature line: extract page resource / content copy codeMiklos Vajna
So the "sign existing pdf" code can reuse it. (cherry picked from commit 3bb145bd4665a871491b08f75057223bab798d45) Change-Id: I63a811f0c6f2bc2eeb29507aff9bc35e92a081cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97250 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-29sd signature line: extract copyExternalResources() from the pdf export codeMiklos Vajna
Because I would like to reuse this in the "sign existing pdf" code, in vcl::filter::PDFDocument::WriteAppearanceObject(). (cherry picked from commit 8277073ce3e33788d93b3df490a8f03d1814863b) Conflicts: vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/pdfwriter_impl.hxx Change-Id: Ia5e5c1e452bb0d0486bde2a082375b5131eea8c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97248 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-29vcl: namespace PDFWriterImpl consistentlyMiklos Vajna
We had a mix of 'using namespace vcl;' and 'namespace vcl {', standardize on the later. (cherry picked from commit c43e62f26f8d51c2ad97f6c93877ce9d3ae9639e) Conflicts: vcl/source/gdi/pdfwriter_impl.cxx Change-Id: I088bb0e0c03f712242427bf6a0b31dd17755b9dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97245 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-07vcl: When exporing PDF, write the correct page of embedded PDFTomaž Vajngerl
We can display PDF as an graphic in the document, where the PDF is treated as a vector graphic and rendered with Pdfium. When in that case we export the document as PDF, we can insert the original PDF page as an reference XObject. This workes fine, however the PDF as an graphic also contains the page number, which page should be rendered. This was not taken into account in the PDF export - it was hardcored to first page. This extends the support so it reads the page index from the graphic, and sets the correct PDF page. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92924 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 218ad66010fdba3c28564e2038876b6822752243) Change-Id: I15188ee495f9b3fcc3aa7df6f4bad4fa09903c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95700 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2020-06-06pdfium: Make Insert -> Image... use VectorGraphicData for PDF.Jan Holesovsky
In principle, the current Svg/Emf/Wmf and PDF handling is trying to achieve the same thing: Keep the original stream untouched, provide a replacement graphics, and a kind of rendering. To hold the data, the Svg/Emf/Wmf and PDF were using different structures though. This commit consolidatates that, and makes the Insert -> Image... (for PDF) actually using the VectorGraphicData to hold the original stream. This breaks loading the PDF as a document via PDFium - I'll fix it in the next commit(s). Change-Id: Iac102f32b757390a03438c165e430283851cc10b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90561 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95618 Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2020-05-05Change default PDF version to 1.6 (released in 2004)Miklos Vajna
We already write markup which is newer than 1.5, but the PDF version was not changed. Fix the one violation I'm aware of. Printing is left unchanged, similar to how commit 99ac4ee05b039166eedfe361fb985682fd92dd13 (Change default PDF version to 1.5, 2018-04-24) updated the default last time. (cherry picked from commit 141e0449fdab89384564659191492b698e4b13d8) Conflicts: filter/source/pdf/pdfexport.cxx include/vcl/pdfwriter.hxx Change-Id: I9598dc46fe7db428bd2eff98bebff8b3c873b4ff
2020-05-05PDF export: fix handling of page sizes larger than 508 cmMiklos Vajna
The value of these coordinates are not allowed to be larger than 14 400, and Adobe Reader complains about them. Use UserUnit to declare in case we won't work with points anymore, but with a larger unit. This will mean UserUnit=2 in practice, since e.g. Draw has is page size limited to 600x600cm, so larger values won't happen, at least not for now. (cherry picked from commit 4830592b780833cf5eee2aef30bc9c5d444dfb24) Conflicts: vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/pdfwriter_impl.hxx Change-Id: I8ee159f2571f4070aded85388792a215de86f7ff
2020-03-17tdf#130150 Improve clipping in PDF exportArmin.Le.Grand (CIB)
For more info and discusson please have a look at the task. It reverts the change from tdf#99680 which did a wrong paradigm change in how clip in Region(s) is defined and tries to fix the underlying error in a more correct way. This includes problems noted in tdf#44388 and tdf#113449. This is a decent improvement, but - due to dealing with numerical problems - not yet the whole healing. Still thinking about how to solve this for good. Adapted PdfExportTest::testTdf99680() and PdfExportTest::testTdf99680_2() as needed, empty clip regions are allowed again. Added comments, too. Had to change solvePolygonOperationAnd to work on ranges if both inputs *are* ranges. The AND-case is then completely solvable. Also increased geometry for transformations of clip geometries - may help later. Change-Id: I2370447597faa6efb81d58ee31c63654e304262e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89874 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 6dff631f8f4b964b48aadde52a1e1b8b04b9ba53) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89923 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-06tdf#129976 PDF export of PDF images: adapt transparency to renderingMiklos Vajna
The bugdoc has a transparent PDF image, and we currently put a white background behind that in Impress, given that vcl::RenderPDFBitmaps() works with Bitmap instances, not BitmapEx ones. This means that in case we preserve transparency during PDF export, the content that was rendered OK now becomes unreadable. Adapt the PDF export to do the same as rendering by putting a white background behind the PDF image. (cherry picked from commit 7088140dbf1d5e0391c2662f0213018a45620ff9) Change-Id: I4edcb12fab71bb305d97a50d20fbfbf86d9aab85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87956 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-15tdf#128434 really free the VclPtr<PDFWriterImpl>Jan-Marek Glogowski
This fixes the major reference cycle introduced by my commit b85ff98383942360901b8242cf77366782400426 ("Change PDFWriterImpl into an OutputDevice"), and adds the missing disposeAndClear() call. Maybe it would be better to add a ScopedVclPtr in the PDFWriter class and revert all the other VclPtr<PDFWriterImpl> users back to the original PDFWriterImpl*. The PDFWriter code really doesn't need any of the special VclPtr handling. Change-Id: Ia64fb207ad274d9323e350022f6b8af35c44e9f5 Reviewed-on: https://gerrit.libreoffice.org/82562 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 4dd87ccdab80eb094cede538e3d742148df3880a) Reviewed-on: https://gerrit.libreoffice.org/82660
2019-11-06vcl PDF export: fix re-exporting PDF images with page-level rotationMiklos Vajna
PDF images are effectively 1 page PDF documents. The page object may have a /Rotate key, which was simply ignored before. We turn page objects into form XObjects on PDF export, such rotation can be expressed with a /Matrix key. Add support for the 90 degrees rotation case, this can be generalized later if wanted. Change-Id: I55a4f63e0b986637ccdeba0b783f1db9a85c4d93 Reviewed-on: https://gerrit.libreoffice.org/82154 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-05vcl PDF export: fix re-exporting PDF images for dict obj resource sub-keysMiklos Vajna
Re-exporting PDF images works by tokenizing the PDF image, identifying which PDF object is the page object and then copying that over to the PDF output, together with the dependencies of that object. This involves copying the resources of the page object. Previously we assumed that the sub-keys of the resources are always inline dictionaries, but the bugdoc shows that they can be references as well, which point to dictionary objects, so add support for this scenario. Change-Id: I78ee1c726e6ecd958232e9fab64773595e5b9c86 Reviewed-on: https://gerrit.libreoffice.org/82076 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-02New loplugin:conditionalstringStephan Bergmann
Change-Id: I2eab990c15f845b44a3b598571aca361dadf9ff3 Reviewed-on: https://gerrit.libreoffice.org/81946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Remove some memset callsMike Kaganski
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-16loplugin:bufferadd loosen some constraintsNoel Grandin
and extend O*StringView to have a constructor that takes a pointer and a length Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8 Reviewed-on: https://gerrit.libreoffice.org/80872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-15new loplugin:bufferaddNoel Grandin
look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14New loplugin:getstrStephan Bergmann
...to find matches of ... << s.getStr() (for the rtl string classes) that can be written as just ... << s Some notes: * The OUStringToOString(..., RTL_TEXTENCODING_UTF8) is left explicit in desktop/source/app/crashreport.cxx (even though that would also be done internally by the "<< OUString" operator) to clarify that these values are written out as UTF-8 (and not as what that operator << happens to use, which just also happens to be UTF-8). * OUSTRING_TO_CSTR (include/oox/helper/helper.hxx) is no longer used now. * Just don't bother to use osl_getThreadTextEncoding() in the SAL_WARN in lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx. * The toUtf8() in the SAL_DEBUG in pyuno/source/module/pyuno_module.cxx can just go, too. Change-Id: I4602f0379ef816bff310f1e51b57c56b7e3f0136 Reviewed-on: https://gerrit.libreoffice.org/80762 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-02loplugin:stringadd in vclNoel Grandin
Change-Id: I21154abe6992418ff2541e5913a0aae0c2c1912c Reviewed-on: https://gerrit.libreoffice.org/79987 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-16vcl:pdf : simplify PDF/A code generationArnaud Versini
Change-Id: I2c5116891d28d37e23048a027124b803af8e25e4 Reviewed-on: https://gerrit.libreoffice.org/78867 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-08-26Embedded PDF: It is a shared_ptr, no need to copy.Jan Holesovsky
Change-Id: Iedb31bbe0e81dc9568e84858d8d26eac03c47ffb Reviewed-on: https://gerrit.libreoffice.org/70208 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit ff2c5e766517bbc23409f04335c418bb6fcad6eb) Reviewed-on: https://gerrit.libreoffice.org/77694 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-25pdfium: Use std::vector to hold the PdfData.Jan Holesovsky
This fixes the destruction of the static cache of the PDF data; without this, there were already missing uno runtime info. (cherry picked from commit 20055ebe1b27f716a2acf1f0f4dda2864ae811bf) Change-Id: I877c9ccf96c4b7eabf3d643e17f324d86d987f94 Reviewed-on: https://gerrit.libreoffice.org/77691 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2019-08-20loplugin:constvars in vclNoel Grandin
Change-Id: Ic454a4d9520992eaecef4b64ec73d49e52ffcc2c Reviewed-on: https://gerrit.libreoffice.org/77828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-24tdf#42949 Fix IWYU warnings in vcl/source/[f-i]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9991a1f4d8dde51b38cf8d114e4fb69ff4a349ea Reviewed-on: https://gerrit.libreoffice.org/75248 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-23Avoid overflowing conversion from double to sal_Int32Stephan Bergmann
...by clamping the value to the sal_Int32 range. An alternative would be to instead print nAdjustment as a real value (which the PDF standard apparently supports, without giving limits to such real values), as had been implemented at <https://gerrit.libreoffice.org/#/c/74543/1>, but that was deemed unnecessarily complex, as no sane document should require nAdjustment values outside the sal_Int32 range. `--convert-to pdf caolan/drawinglayer_emfphelperdata_heap_use_after_free.sample` (from the crashtestdata files) has cases where double fAdvance = aThisPos.X() - aPrevPos.X(); gets rather large (whether or not that's faithful to the input document, or a consequence of an earlier import error), so failed with > vcl/source/gdi/pdfwriter_impl.cxx:6078:66: runtime error: -5.83192e+09 is outside the range of representable values of type 'int' > #0 in vcl::PDFWriterImpl::drawHorizontalGlyphs(std::__debug::vector<vcl::PDFWriterImpl::PDFGlyph, std::allocator<vcl::PDFWriterImpl::PDFGlyph> > const&, rtl::OStringBuffer&, Point const&, bool, double, double, double, int, int) at vcl/source/gdi/pdfwriter_impl.cxx:6078:66 > #1 in vcl::PDFWriterImpl::drawLayout(SalLayout&, rtl::OUString const&, bool) at vcl/source/gdi/pdfwriter_impl.cxx:6404:17 > #2 in vcl::PDFWriterImpl::drawTextArray(Point const&, rtl::OUString const&, long const*, int, int) at vcl/source/gdi/pdfwriter_impl.cxx:6621:9 > #3 in vcl::PDFWriter::DrawTextArray(Point const&, rtl::OUString const&, long const*, int, int) at vcl/source/gdi/pdfwriter.cxx:87:22 > #4 in vcl::PDFWriterImpl::playMetafile(GDIMetaFile const&, vcl::PDFExtOutDevData*, vcl::PDFWriter::PlayMetafileContext const&, VirtualDevice*) at vcl/source/gdi/pdfwriter_impl2.cxx:878:34 [...] In the original compuation of sal_Int32 nAdjustment, the "+ 0.5" was presumably intended to round to the nearest integer, even though it would have rounded towards zero for negative values (as conversion to integer truncates). So use std::round to always round to the nearest integer, including for negative values. Change-Id: Ie3ddbb66421f47417c6d9ae096f2207a29aca4a4 Reviewed-on: https://gerrit.libreoffice.org/74543 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-20cid#1448527 Unchecked return valueCaolán McNamara
Change-Id: I31c7cc4ee308c7e3841067b5bc5536ac1382e941 Reviewed-on: https://gerrit.libreoffice.org/76010 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-19cid#1448527 Unchecked return valueCaolán McNamara
Change-Id: I024b2cc088027cfb74dc009220e75e24b7228ea2 Reviewed-on: https://gerrit.libreoffice.org/75902 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-06Constify GlyphItemJan-Marek Glogowski
This hides all the data, which shouldn't change after init. Real const makes a lot of problems for copying, so this is the 2nd option to just add getters for private data. While at it use typed_flags for the GlyphItemFlags. Change-Id: Ic1eeabe2398f6c30080fdd516285b72c620b11be Reviewed-on: https://gerrit.libreoffice.org/75147 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-07-02tdf#113448 Export font used for checkbox markThorsten Behrens
Related tdf#93853 make sure we use the opensymbol nice checkmark (0x2713) to compel viewers to use that. Change-Id: Id5028b0d062e0491b1cc9c36e2d9d4e4a7ab14a1 Reviewed-on: https://gerrit.libreoffice.org/74995 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-07-02tdf#113448 don't export any font for radio buttonsThorsten Behrens
Change-Id: Ie84b19a3dfaec32184bb825b7593ec33a5c4145c Reviewed-on: https://gerrit.libreoffice.org/74994 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-08improve tools::Rectangle->basegfx::B2?Rectangle conversionNoel Grandin
Improve the conversion method to do something reasonable with empty Rectangle. Use the conversion method in more places. Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503 Reviewed-on: https://gerrit.libreoffice.org/71853 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-05-02Use hasElements to check Sequence emptiness in [v-x]*Arkadiy Illarionov
Similar to clang-tidy readability-container-size-empty Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c Reviewed-on: https://gerrit.libreoffice.org/71603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12prefer vector::data to &vector[0]Caolán McNamara
probably missed loads more Change-Id: I53c9fe188055ef925fed54500e64b837cd56a1e7 Reviewed-on: https://gerrit.libreoffice.org/70676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-08pdf: always write resource dict for content streamsThorsten Behrens
Take out: - revert i#42884 workaround for AR5: use implicit resources in transparency groups Since verapdf complains with FAIL 6.2.2-2 in this case - missing resource dict for content stream. Change-Id: Ic186d2b4b393ac34f991a6747667332cf8f4658b Reviewed-on: https://gerrit.libreoffice.org/70391 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-27Remove stale testcodeThorsten Behrens
Change-Id: I64a0b9cd4a727349016aa307d5c4835158a93109 Reviewed-on: https://gerrit.libreoffice.org/69822 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-17tdf#113448 fix PDF forms exportThorsten Behrens
This fixes verapdf A-2 validation error '6.3.3-2 annotation appearance dict is wrong'. Controls that use type /FT/Btn must have sub-dicts as /N content, instead of a direct stream reference. Change-Id: If985644fe3d583e98a0b3a703e4b33dbf652f165 Reviewed-on: https://gerrit.libreoffice.org/69295 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-16tdf#62728 add PDF/A-2 support, change UI default to use thatThorsten Behrens
There was not much missing to make LibreOffice export valid PDF/A-2, so let's add that, and switch the UI to use that instead of A-1. The old PDF/A-1 feature is still accessible via UNO / filter parameter 'SelectPdfVersion': - 1 gives you PDF/A-1a - 2 gives you PDF/A-2b - 16 gives you PDF 1.6 Change-Id: Iea4262b119bcf33b75f3d1406cc793bdcaec65d1 Reviewed-on: https://gerrit.libreoffice.org/69294 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-02-19read/written as 32bit integersCaolán McNamara
so just use those 48->32 bytes ofz#13164 1.195G -> 1.190 Change-Id: I145049c9d5fba04c8d5b4271190d7e62755bf8bf Reviewed-on: https://gerrit.libreoffice.org/67964 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-12Resolves: tdf#123298 resize before writing to vectorCaolán McNamara
Change-Id: I8fc25d254781b31e4ffafcf4397a95d79e042cd8 Reviewed-on: https://gerrit.libreoffice.org/67736 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-11loplugin:indentation in vclNoel Grandin
Change-Id: Idd7166833764fdf1d9c42a050490572a8b330199 Reviewed-on: https://gerrit.libreoffice.org/67610 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>