summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
AgeCommit message (Collapse)Author
2018-06-30cppcheck: variableScopeJochen Nitschke
and use unique_ptr for vector elements Change-Id: I5421a53e96928699fd451d4ff3e2eef0bf847f42 Reviewed-on: https://gerrit.libreoffice.org/56772 Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-06-27This assert() seems superfluousTor Lillqvist
The assertion fails when one reproduces tdf#69460 but removing the assert() does not cause any problems. Change-Id: Idaa5d41a0cf76073e406d7152fc3b4e9ebd3e876 Reviewed-on: https://gerrit.libreoffice.org/56538 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2018-06-21use more OutputDevice::GetBitmapExNoel Grandin
instead of GetBitmap Change-Id: Ib43cfaf3c91968d623e5a24f44539368da28d36f Reviewed-on: https://gerrit.libreoffice.org/55190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-19tdf#103913 keep ".emf" file extension and mime typeLászló Németh
in documents, don't change them to wmf and image/x-wmf silently, resulting for example, dropping or rejecting modified documents by firewall packet filtering. Change-Id: I3b8634ae022c7c026b0ed4ebc345c1c3b3f96337 Reviewed-on: https://gerrit.libreoffice.org/56045 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-06-18vcl: share GfxLinkAshod Nakashian
When importing PDF as images, we store the PDF stream in the GfxLink. For large PDFs storing a copy of the full PDF with each page is overkill. For example a 10MB PDF with 200 pages will consume 2GB of memory! Change-Id: I99913514cf5c562683080bc817668095bee69427 Reviewed-on: https://gerrit.libreoffice.org/55571 Tested-by: Jenkins Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2018-06-16vcl: parser of font features included in the font nameTomaž Vajngerl
Change-Id: I7347410b4eb5e940d94c34aac4fdf344869541fa Reviewed-on: https://gerrit.libreoffice.org/55893 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-06-14return SalBitmap using std::shared_ptrNoel Grandin
since we hold it like that in Bitmap anyway Change-Id: I6264dfaaae6210cb008df5db8a421fc80c508f5b Reviewed-on: https://gerrit.libreoffice.org/55458 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-12crashtesting: asserts on inability to scale oversize graphicsCaolán McNamara
since... commit d46c32140fdb05758c039dd27552b1788faac104 Date: Thu Jun 7 12:37:33 2018 +0200 assert in BitmapInfoAccess if bitmap is empty or we can't read from it Change-Id: I138a53e9ce0763d4e62cfbba594abb323e807378 Reviewed-on: https://gerrit.libreoffice.org/55704 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-12remove incorrect SAL_WARN in BitmapInfoAccess::BitmapInfoAccessNoel Grandin
just because use_count is > 2, doesn't mean we have two simultaneous writes, could be 2 readers and a writer Change-Id: Ife7fc91ff2e597e6bb847460f46bdde954e63e4f Reviewed-on: https://gerrit.libreoffice.org/55695 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-12loplugin:constantparamNoel Grandin
Change-Id: Ia769b3176aea287cd57414d7ce8e88c6da43883e Reviewed-on: https://gerrit.libreoffice.org/55622 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-11loplugin:unusedfieldsNoel Grandin
Change-Id: I42a55562747e6097c1193e285da67235f5364bea Reviewed-on: https://gerrit.libreoffice.org/55610 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-11loplugin:unusedmethodsNoel Grandin
Change-Id: I26a0da1ec9cda9030371977596053a45303756a0 Reviewed-on: https://gerrit.libreoffice.org/55609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-11drop PhysicalFontFace::CloneNoel Grandin
since we are now holding these via reference counting, no need to clone them Change-Id: I7b0bd86f4a5bca428f7dcd989f838a9aa0c7e179 Reviewed-on: https://gerrit.libreoffice.org/55427 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-09rename SalPrinterQueueInfo::mpSysData to mpPortNameNoel Grandin
and simplify, most places can just leave it alone Change-Id: Id938ec12d21ef244a15b5e5a72626c5ad0d0e124 Reviewed-on: https://gerrit.libreoffice.org/55499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-09hold and return SalPrinter with std::unique_ptrNoel Grandin
and remove DestroyPrinter, doesn't not anything beyond delete'ing the object Change-Id: I25e14b962e65a0e131fae3ff5771c82920a4e375 Reviewed-on: https://gerrit.libreoffice.org/55498 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08hold LogicalFontInstance with rtl::ReferenceNoel Grandin
instead of manual reference counting. Also the releasing of not-currently-in-use LogicalFontInstance objects from the cache is made less aggressive - we now only flush entries until we have less than CACHE_SIZE instances, instead of flushing the whole cache. Change-Id: Ib235b132776b5f09ae8ae93a933c2eebe5fa9610 Reviewed-on: https://gerrit.libreoffice.org/55384 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-06-07assert in BitmapInfoAccess if bitmap is empty or we can't read from itNoel Grandin
and fixup the "make unique if two things want to write to bitmap at same time" check, it was using maBitmap before maBitmap has been assigned to. Lets just make it check something more useful, like the share count of the underlying SalBitmap. Change-Id: I97a629457174da2e4df1edc9674290aa9c9a2b52 Reviewed-on: https://gerrit.libreoffice.org/55416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07manage PhysicalFontFace by rtl::ReferenceNoel Grandin
Change-Id: I8f66b5afb066fe83abb83c56ebde6f21197f894b Reviewed-on: https://gerrit.libreoffice.org/55333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07vcl: svx: misc improvements to pdfium importingAshod Nakashian
Change-Id: I58f2fd973a731b148f40b37139cd74bac097a7d2
2018-06-07sd: render the correct PDF page on swapping inAshod Nakashian
Change-Id: I81225e228d9cf2b9849110715dbfdeb59f2805dd Reviewed-on: https://gerrit.libreoffice.org/54746 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
2018-06-07sd: support breaking any PDF pageAshod Nakashian
Change-Id: Ifa5f58163bef209a988fc0f88e2b609b1973e0d4
2018-06-07svx: support importing PDF imagesAshod Nakashian
Change-Id: Id4524a30b8f9fa4228c4acb4bf8714700da3017c
2018-06-07svx: support breaking PDFs imported as imagesAshod Nakashian
Change-Id: I990c2b3c3055fbffddedc407c34beb5824277b38
2018-06-07vcl: svx: preserve the imported PDF page number in GraphicAshod Nakashian
Change-Id: I1bb3fa7d44d5f92df2bb8c4ed4b85ccd984c2617
2018-06-07sd: import PDFs as images using Pdfium new SdPdfFilterAshod Nakashian
LOK now opens PDFs as images using Pdfium, which has a superior accuracy and support to poppler, the default pdf reader. Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
2018-06-07pdf: share pdf data in GraphicAshod Nakashian
Change-Id: I8146aa4e206788afff71142e1877fd7a885f4652
2018-06-05tdf#102928 PDF export: do recompress CMYK imagesMiklos Vajna
The export filter writes /DeviceRGB unconditionally, so for now don't optimize CMYK image handling here. Though the added GraphicDescriptor API allows supporting this natively in the export filter in the future. Change-Id: I76b44b910948467aeb1f15e5ae765201d183c99d Reviewed-on: https://gerrit.libreoffice.org/55343 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-06-05forms - move the Bitmap accessing code inside BitmapExNoel Grandin
Change-Id: I58d5200332c133146adb6bb99b4b88697f03990a Reviewed-on: https://gerrit.libreoffice.org/55313 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-05reducing Bitmap copying in BitmapExNoel Grandin
Change-Id: I674230548c6a10cfcc3c4c2542e48fd999b80e57 Reviewed-on: https://gerrit.libreoffice.org/55314 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-02valgrind: uninitialized readCaolán McNamara
Change-Id: I29811f652c2368a0fecef66dd02343d12ee67068 Reviewed-on: https://gerrit.libreoffice.org/55178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-01use more BitmapEx in filterNoel Grandin
Change-Id: I68fdad6a69a178df8c59c4272f1d8d0b2f101315 Reviewed-on: https://gerrit.libreoffice.org/55163 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-01remove old "convert to SVM1" code only active in debug modeNoel Grandin
Change-Id: I1d83e6ea5f8eb998f95e6ec334a695eb1df78df1 Reviewed-on: https://gerrit.libreoffice.org/55173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-31drop Graphic::GetBitmapNoel Grandin
so that we flush out various code using Bitmap, in favour of using BitmapEx. This is part of the process of making Bitmap largely an internal detail of vcl Change-Id: Iaf2ead5e3d9960838723fb55b812b97108093d74 Reviewed-on: https://gerrit.libreoffice.org/55062 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-29Change SFErrCodes to scoped enumStephan Bergmann
Change-Id: Ib2f267397e419e8164bb2d732f7cbcca7acad1a6 Reviewed-on: https://gerrit.libreoffice.org/54996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-28loplugin:unusedmethodsNoel Grandin
Change-Id: I64df1f467986b3d70c058adff289a6dd8f00fb20 Reviewed-on: https://gerrit.libreoffice.org/54821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-25tdf#113143 PDF export: fix mis-scaled JPGs on Impress note pagesMiklos Vajna
This is really similar to commit 4c2172a3e973bc6351107a3a1b554c77b40b75dd (tdf#106702 PDF export: fix missing images from Writer headers/footers, 2018-05-22) just this one is about the size of the output rectangle for JPG content, while the previous problem was about the position of them. Also extract PdfExportTest::exportAndParse() from the last two tests to avoid duplication. Change-Id: I9812924d505e9fdaca2a95b4990e7aaa5e44fd7f Reviewed-on: https://gerrit.libreoffice.org/54773 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-22tdf#106702 PDF export: fix missing images from Writer headers/footersMiklos Vajna
Position of an image is determined by the relevant bitmap scale metafile action when recompressing images. The same position was determined by PDFExtOutDevData "meta" info when not recompressing images. This second rectangle was never correct for images repeated in Writer headers/footers on non-first pages: the position was relative to the page, while PDF export sets the map mode (origin) of the output device during export, so such positions are expected to be absolute ones. The root of the problem seems to be that header images in Writer are both repeated (as the user sees it) and unrepeated (as the doc model sees it), and by the time we want to get its position, we only see the unrepeated SdrObject. Fix the problem by using the correct position from the scale action and not from PDFExtOutDevData if possible. (Also give up on running CppunitTest_vcl_pdfexport in the non-pdfium case, most of the tests there do require pdfium anyway, and the growing ifdef forest in that file just made it hard to read the code.) Change-Id: I31c14d4bd223b2804859982542ebd6d5f9abd312 Reviewed-on: https://gerrit.libreoffice.org/54674 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-05-20tdf#117502 fix graphical bullets for OOXML and RTFTomaž Vajngerl
This change has multiple parts: - Move "BulletAsImage" test from ODT only to globalfilter and run it on ODT, DOC, DOCX, RTF formats and extend checks of the XGraphic used for the bullets and the size. - Check if GIF is animated as we need to know this in unloaded graphic or bullets aren't rendered correctly if we assume they are animated. - Use "Graphic" property in writerfilter to get the graphic from a XShape and not the "Bitmap" property which returns a Graphic as a MetaFile and not the original Graphic. - Make sure "GraphicBitmap" is filled with XBitmap and not with XGraphic. - Change "testFDO74215" to use the expected bullet size as it is in the original document. Looks like the initial bug was just asserting the bullet size is set to a value (non-zero). Change-Id: I6b151c0bf9f426669e07522f0fc699fbb652046b Reviewed-on: https://gerrit.libreoffice.org/54477 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-17tdf#105954 PDF export, ReduceImageResolution: fix re-compressing large imagesMiklos Vajna
Expensive re-compress is not pointless when the user opts in to reduce resolution. Change-Id: I1e04c6d4f0d95d41808ef885082239645401b2e2 Reviewed-on: https://gerrit.libreoffice.org/54384 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-05-17loplugin:unusedfields in vclNoel Grandin
Change-Id: Id0913b209b089e3c66a7e449e31f8d5d5b1b4f83 Reviewed-on: https://gerrit.libreoffice.org/54413 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-13vcl: move Bitmap::MakeMonochrome() to BitmapMonochromeFilterChris Sherlock
Change-Id: Iefe5be4349475a4aa0138534cf6bfe87ff7df245 Reviewed-on: https://gerrit.libreoffice.org/53280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-12make Bitmap/BitmapEx constructors explicitNoel Grandin
and add BitmapEx::operator=(Bitmap const &) Image::Image(Bitmap const &) to lessen the fallout Change-Id: Iff5fab88d167a7be739c370c9933d36c297bc61c Reviewed-on: https://gerrit.libreoffice.org/54162 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-12make AlphaMask constructors explicitNoel Grandin
to reduce surprises in some changes I'm planning Change-Id: I61cb58d51ab77f57e55159017c7bece5bd99953f Reviewed-on: https://gerrit.libreoffice.org/54161 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-12SalLayout::CalcAsianKerning() can be made localKhaled Hosny
Change-Id: Ieff9fda888112e98236d846aa6cf9140be8b355a Reviewed-on: https://gerrit.libreoffice.org/54152 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-12Drop trivial, used only once, functionsKhaled Hosny
Change-Id: I387dd91464b211eb892dd4a3adc0b8dae6f84fa2 Reviewed-on: https://gerrit.libreoffice.org/54097 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-12tdf#117427 missing API for determining and loading linked graphicTomaž Vajngerl
This adds 2 properties to GraphicDescriptor: "Linked" - to indicate if the graphic is a linked one "OriginURL" - the URL of the location from where the graphic was or will be loaded (and is linked to) Additionally GraphicProvider was extended with a "LoadAsLink" (media)property, which can be passed using queryGraphic method. If "LoadAsLink" is set to true, then the Graphic will be created as a linked one. In addition the tests for this API was added to VCL (home of this API implementors). Change-Id: Ibdabe5e7780d1b372d1e66c3e19b18779fee2c9a Reviewed-on: https://gerrit.libreoffice.org/54090 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-05-12Use HarfBuzz to get Kashida widthKhaled Hosny
One less platform-specific piece of code. Change-Id: Ib04c5f1434046e26ead2aaedace67127a5513e55 Reviewed-on: https://gerrit.libreoffice.org/54098 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-11Fold CommonSalLayout into GenericSalLayoutKhaled Hosny
Now the crazy constructors of CommonSalLayout are gone, we can merge the two and drop one level of indirection. Change-Id: I166e4ed2c9d22c1ce75246d486f7526c4928f652 Reviewed-on: https://gerrit.libreoffice.org/54077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>