summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)AuthorFilesLines
2017-09-18detect corrupted job setupCaolán McNamara1-7/+15
Change-Id: I0d3b4850c3d4c015a0a7e5d36d87113a749c7e0f Reviewed-on: https://gerrit.libreoffice.org/42385 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 1eb3822d74f535f75aa336b27568ee8a6084c4dd)
2017-09-08Resolves: tdf#107249 round ascent/descent/extleading on conversion to intCaolán McNamara1-10/+15
Reviewed-on: https://gerrit.libreoffice.org/41944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 0c8b749e602b6743857a9bc4efb24b6183690311) Change-Id: Ia3ab5960d5288f5831aaa4ade800ca7513dad766 Reviewed-on: https://gerrit.libreoffice.org/41956 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit e0ea7df25faeaae9f98ebde32f49eec92603d629)
2017-09-04tdf#104252 EMF rendering, set correct VirtualDevice sizeSzymon Kłos1-2/+2
ClipRegion is bounded to device size. That resulted in missing text in case of PDF export with EMF+ images under Windows (with hardware acceleration). VirtualDevice size was always equal to the screen resolution what is not enough to draw complete PDF. This patch modifies VirtualDevice size to match target size. Change-Id: I762be6a6ca6fab3897b57f370fecc3f3568a58cb Reviewed-on: https://gerrit.libreoffice.org/41390 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2017-08-11Resolves: tdf#99286 for jpeg dpi use apis that know about MapUnit::MapPixelCaolán McNamara2-14/+16
move the code which can do this from sw to vcl Change-Id: I9940fb80ecdbfe8f70afc500c691288ed0993701 Reviewed-on: https://gerrit.libreoffice.org/40932 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 939538e6a8d35c8ab4412908482feb053386bf3d)
2017-08-03lok - add support for in place chart editingMarco Cecchetti2-0/+10
This commit add a minimal support for editing chart embedded in a spreadsheet or a text document or a presentation. Graphic object can be moved and resized, text object can be edited. Change-Id: I8e637dabf328a94bd6bb0e309a245302cff421d8 Reviewed-on: https://gerrit.libreoffice.org/40681 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-31gtk3: Resolves: tdf#109277 take modifier key into account for dndCaolán McNamara1-2/+26
Change-Id: Id0aa4ced8644ddbee9e1a0453887f07907547aae (cherry picked from commit 0c840d9bf308464d58a2df8aaa1e61481b5e4f52) Reviewed-on: https://gerrit.libreoffice.org/40477 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3cb369463e4e9d0a00baee3adf10957d1ed7ed83)
2017-07-31Resolves: tdf#109289 add SvxColorListBox::IsValueChangedFromSavedCaolán McNamara1-1/+0
and remove PushButton::IsValueChangedFromSaved (cherry picked from commit 39fd7e97c253153a10161ef3694b64e90e65e80a) Related: tdf#109289 move PushButton::IsValueChangedFromSaved to consumer inheriting the IsValueChangedFromSaved from PushButton has allowed undesirable behaviour to be selected (cherry picked from commit 247607727986df0fd0fef198459eb6646e056ea3) Change-Id: Ib1c51e27fd708c5d4811c90ef5659b4d55dd8860 fccb1657d2565005e6f9e239c6118f2e5ae7970c Reviewed-on: https://gerrit.libreoffice.org/40486 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit d747a00f550cc8556e29b29b08c57f84afb4078f)
2017-07-31tdf#104883 Don't call InstallFontconfigResources if it's not availableSamuel Mehrbrodt1-0/+9
We need to call it once because we have no other way to detect whether it's working or not. But if we receive an error the first time, we disable it from now on. Change-Id: I67dba8b65660ff7e05bdf2ddc18b565550901cd1 Reviewed-on: https://gerrit.libreoffice.org/39895 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f86d9d732d9b2aa711d321a8c9f4110b638560b4)
2017-07-13tdf#106990 set cleartype setting / force to use GDI render modeTomaž Vajngerl2-3/+85
With this we read the system setting for cleartype and set it to the render target we are using. Additionally we set the GDI like rendering mode which forces that the text is rendered similar as this was done with GDI. Change-Id: If6fb72bc371accf50278c968c94e625aee3f0953 Reviewed-on: https://gerrit.libreoffice.org/39602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2017-07-13tdf#107166 BindDC doesn't handle 0 width/height rect consistentlyTomaž Vajngerl1-1/+4
When binding a GDI device context to D2D we need to provide a rectangle where the surface will have effect. When we just need some font information we need to bind the DC too, but we aren't really interested what the rectangle is, so we just provided a 0,0,0,0 rectangle in that case. This sometimes fails with a "out of memory" result and is dependent on the renderer. Instead of 0,0,0,0 rectangle we rather define a 0,0,1,1 rectangle which should never fail. This is not problematic as for actual rendering we later rebind with an actual rectangle. Conflicts: vcl/inc/win/winlayout.hxx Change-Id: I79c7f0cf4d69f213370ed26a811a908ed16070ff
2017-07-12make opengl transitions under X flicker free on enter/leaveCaolán McNamara5-2/+53
Change-Id: I109637dc6b3d23c0beca21f3cf0c7ba918ecb4f8 Reviewed-on: https://gerrit.libreoffice.org/38749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 277395b6266c57a7709c3c47986f135f6789c8e7) Reviewed-on: https://gerrit.libreoffice.org/38753 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit b49779db18fa094f3b2f4166ee93c072d2f117a1)
2017-07-12Resolves: tdf#108452 gtk3 xbm cursors invisible on black bgCaolán McNamara1-6/+15
Change-Id: I5c9b27862da6ac76ae38542f85a51f9aefdd013d Reviewed-on: https://gerrit.libreoffice.org/39113 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 57272e5476d15d355018883c1cc9762d785d967c)
2017-07-06Don't let m_nGrabLevel become negative, tdf#108705 relatedEike Rathke1-3/+6
... which then later leads to 2 Giga loops on the next GtkSalFrame dtor call, for example on the second AutoFilter button popup in Calc. Fall-out from commit 9b32355ea6d8d5e34363ba0c57e74d75d7a7b1b7 Date: Fri Jun 23 12:48:12 2017 +0100 Resolves: tdf#108705 remove grabs on widget before destroying it that brought this to surface. Change-Id: I0edb7eec9384c716800f07ef1ed91fc8f1d7c119 (cherry picked from commit 637d917d7551fed19c9685f974fb3e732a8f97e2) Reviewed-on: https://gerrit.libreoffice.org/39388 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 5eec9409f10d1a08c826edb689eefb86240b7b25)
2017-06-27Resolves: tdf#108705 remove grabs on widget before destroying itCaolán McNamara1-0/+5
Change-Id: If02a0b4340788db638c74b98e855258145643452 Reviewed-on: https://gerrit.libreoffice.org/39167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit d8677b79fedda8a13f560e1a9a7ca8b36642366b)
2017-06-27ofz#2287 check multiplyCaolán McNamara1-1/+9
Change-Id: Ibc4c93ac1f5686a476b5e303347dc951daa58e33 Reviewed-on: https://gerrit.libreoffice.org/38911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 67caad3c98d045b8de3e4bf2f63efda2e9d8cc48)
2017-06-21tdf#99680 modified clipping for PDF exportVasily Melenchuk1-5/+6
If clipping is requested, but no clipping region is defined, clipping is ignored. This squashes the following 3 commits: Reviewed-on: https://gerrit.libreoffice.org/38021 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/38403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/38694 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/38825 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit f6726209329fefe9decca8fda8e136b8472a95a2) Conflicts: vcl/qa/cppunit/pdfexport/pdfexport.cxx no pdf unit tests on -5-3, so dropping those pieces Change-Id: I793c1de1f4f6b0203727c0ff6aa8adecc43ad413 d4565858b0135b3177044558db87a68ef828955b 102722140e216cb9ad29107aae3bdaa70472d471 Reviewed-on: https://gerrit.libreoffice.org/38852 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 581806182ac7da81115c9675b4e828688178aa04)
2017-05-31tdf#108056 PDF export: work with double page sizeMiklos Vajna3-8/+8
Our coordinate system has the origo in the top left corner, PDF's one is at the bottom left corner. So the page height affects the coordinate of all widths and y positions. That page width is 870.25 in the case of the bugdoc, but it was handled as 870 due to the integer rounding. The coordinates and heights are now closer to the expected ones. (cherry picked from commit a05dc747caf5b8fef6bd95a999cb6098f2b4dbc7) Conflicts: include/vcl/pdfwriter.hxx Change-Id: I9c7d77298df3850bbc170c9ace18120900d7e3fa
2017-05-31Resolves: tdf#108111 backport mono checkboxes fixCaolán McNamara1-3/+1
replace the blue which will be set to transparent, with transparent and then we don't "manually" replace a color with transparent which makes tdf#108111 look right again (cherry picked from commit f1a8e00764b32c3b799ecd40dcb4dd632493bc45) Change-Id: I95923685d412145e88b672a50311c767d1425493 Reviewed-on: https://gerrit.libreoffice.org/38223 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit ec49295718144aeeb81683bcfe5923c3610e8d21)
2017-05-30tdf#107682 - Repeated images replace correct ones in exported PDFMarco Cecchetti1-0/+15
The problem was due to the buffer acquire methods: in Bitmap::Checksum (old implementation) Bitmap::AcquireReadAccess is used to get the bitmap buffer: indeed this method relies on SalBitmap::AcquireBuffer (which is used in the new implementation) but in case the buffer acquisition fails, instead of giving up, it tries to update the imp bitmap instance embedded in the bitmap (see BitmapInfoAccess::ImplCreate). The solution is to perform this further attemp in Bitmap::Checksum when the value returned by ImpBitmap::GetChecksum is 0. Change-Id: Ib901ac941db57756e9a951bacbc573ca206316e0 Reviewed-on: https://gerrit.libreoffice.org/38169 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-05-30Resolves: tdf#108069 2nd OpenGLContext::init should dispose earlier resultsCaolán McNamara1-1/+2
Change-Id: If6bb9517a4081576347d71ddf26d020119d34247 (cherry picked from commit 0b9b36cafe29916a9fdeac420a49c174adb10c59) Reviewed-on: https://gerrit.libreoffice.org/38065 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit c76aa66c60bde1fd009f097a0b974b65b295d1ab)
2017-05-30tdf#107868 PDF export of editeng fill color: restrict to logic map modesMiklos Vajna1-1/+4
The original use case was Writer/Impress shape text, but when the map mode is pixels, the reference device gives bogus values for the PixelToLogic() calls, affecting e.g. form controls. Just go back to the old way of not painting the background for those. (cherry picked from commit 919a4ef592b6026a7533a93682f39118fef29ce8) Conflicts: vcl/qa/cppunit/pdfexport/pdfexport.cxx Change-Id: I52f1901af15732274915fa3c77c06909b5164afb Reviewed-on: https://gerrit.libreoffice.org/37977 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f6a66846f50132fab7be6baf516ab6af04acf7e5)
2017-05-30tdf#103158 ctrl+shift should work on key upMaxim Monastirsky10-51/+26
Under gtk/gtk3 we send CommandEventId::ModKeyChange on key down, to support the auto-accelerator feature. But at least the handler in SwEditWin::Command must get it on key up, in order to not interfere with other ctrl+shift+X shortcuts, which work on key down. To achieve that, we need: - On key up pass the key that was just released, instead of the current state of nothing being pressed. - Have a flag of whether it's a key down or up event, so it can be checked by the application code. Reviewed-on: https://gerrit.libreoffice.org/37275 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit fe0451259d2fb93c809c1bfa3baf5abd90019c58) Conflicts: include/vcl/commandevent.hxx vcl/source/window/commandevent.cxx vcl/unx/generic/window/salframe.cxx vcl/unx/gtk/gtksalframe.cxx vcl/unx/gtk3/gtk3gtkframe.cxx Change-Id: If188d6ccdc3b214a2c3ed20aad291d74d46b358f Reviewed-on: https://gerrit.libreoffice.org/37516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 30c17a288b03656633b626f6e7f679ca7c1aa6ff)
2017-05-30Resolves: tdf#103174 & rhbz#1367846 improve gtk3 trackpad scrollingCaolán McNamara6-59/+122
convert number of "lines" scrolled to double and allow fractional parts of lines/columns Change-Id: Ib99c815cfc8823e22fc1d76e201903c34ed0f61b Related: rhbz#1367846 queue and merge scroll events Reviewed-on: https://gerrit.libreoffice.org/37779 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7f60978b2ccd0e17816b78bde60c6e0e60a9d52e) Change-Id: Ib45f61bbb35bd240829491ac8a79803222974778 Reviewed-on: https://gerrit.libreoffice.org/37913 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit f7d2bf216afa10268e6a7c1d4613a2fd8f7c7f3c)
2017-05-18ofz#1605 check multiply and shiftCaolán McNamara3-4/+50
Change-Id: I6aad9ad23e7bf080b3b610223f92df7074530beb Reviewed-on: https://gerrit.libreoffice.org/37642 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit d881d77429371c3a04b758b151b091267c13d167)
2017-05-11tdf#106265 ScopedHDC to clean-up hDC when rendering glyphsTomaž Vajngerl2-6/+51
Change-Id: I96ecf625126740610200c012c3c7002fac7e1548 Reviewed-on: https://gerrit.libreoffice.org/37347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit dae61482df7ae540a1fb8feefbb92b5e7238444d)
2017-05-04Resolves: tdf#99467 pasting text from java apps to gtk3 gives bad resultsCaolán McNamara1-0/+4
Change-Id: Ib2625c900def20baa470f0a15e4f72a3f763099e (cherry picked from commit c881756fcfdc1fa63ff534bf4538d551b2139515) Reviewed-on: https://gerrit.libreoffice.org/37147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit a090322721222c98f7ccd194eac84e5a76579f8e)
2017-04-26tdf#107205 vcl: don't always use D2DWriteTextOutRendererMichael Stahl2-7/+15
... because it cannot rotate text. (regression from commit df556aa47da22f96b3fcd356c12419d3035cba3c) Change-Id: If9bc6e98b8979c5eb02f1a5cfc12b4d19bdc481b (cherry picked from commit 2eb91035c2f60e9dc476336474d51b23b666bb04) Reviewed-on: https://gerrit.libreoffice.org/36904 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 8f51b4272450b6220f563740538f143c0bc70175)
2017-04-24Handle keyinput properly in case of BottomToTop vertical textTamás Zolnai1-0/+10
Change-Id: I2b0f7cee9a4a7d7ad154c705f84a8b995b4f23a1 Reviewed-on: https://gerrit.libreoffice.org/36830 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 8c46185bf28f61e674186694e4944c1f8b3a9c00) Reviewed-on: https://gerrit.libreoffice.org/36887 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2017-04-24vcl: protect Window from exceptions during construction.Michael Meeks1-2/+8
Probable fix for: http://crashreport.libreoffice.org/stats/crash_details/f69188bd-0fdd-4b74-9ec6-35b544cba0c9 Change-Id: I6442451785867f0fc2daf84776118b092d4d6a18 Reviewed-on: https://gerrit.libreoffice.org/36653 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 6827da5052bfe975a3b34af8dfa8af75d41e904c) Reviewed-on: https://gerrit.libreoffice.org/36674 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 92edd724dd7f1ca85787480f046d48f9f27c51b8)
2017-04-18catch exception like text_wrapper_get_caret_offset doesCaolán McNamara1-1/+8
Change-Id: I7d681a5cd58af60005eefa9969ec975d5cfc5580 (cherry picked from commit 0d2a607a849e3f1b51092c7d96bc5529420cfab2) Reviewed-on: https://gerrit.libreoffice.org/36635 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 615942e388c6dfa48d1edbf645fe6b0dd67cfa40)
2017-04-18tdf#106933 vcl: delete D2DWriteTextOutRenderer before exit()Michael Stahl3-10/+21
As it happens this DirectWrite stuff is using some thread pool internally, and that must be shutdown before exit(), as Win32 will terminate all other threads at that point, and then the thread pool wants to talk to threads that don't exist any more. https://blogs.msdn.microsoft.com/oldnewthing/20120427-00/?p=7763/ So convert this from a global variable that is deleted from DllMain() to a member of SalData, so it is deleted from DeInitVCL(). Change-Id: I51408a07c78758cf0c193ab66b9214d0c9dbd9e3 (cherry picked from commit df556aa47da22f96b3fcd356c12419d3035cba3c) Reviewed-on: https://gerrit.libreoffice.org/36534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 1ba5bae490f7e14e475e0b80f03e5f444cdce908)
2017-04-14vcl PDF import: don't assume larger offset -> newer trailerMiklos Vajna1-3/+34
Usually when the PDF file contains incremental updates the updates are appended at the end of the document. But this is not required, the various trailers can be in any order. Make sure that we look at the last trailer (logically last, not the one with the largest file offset) when looking for pages. Reviewed-on: https://gerrit.libreoffice.org/36527 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit f15a69bd57e578ca607f14cb62f29a16986b96e6) Conflicts: xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx Change-Id: Idcd85a7c6bbf08c9436dd73933d79cdb683f482c
2017-04-12infinite SetDefaultSize->SetPosSize->SetDefaultSizeCaolán McNamara1-1/+2
https://retrace.fedoraproject.org/faf/reports/1278627/ presumably the 'optimal' starting size hits the invalid size path causing another attempt usin the optimal size, so force a valid initial fallback size Change-Id: I6c38ee5e1b90ce41a4550c8a8370e791f5c351b0 (cherry picked from commit 4930acb18bbd145fd995084cd95e3e9d631424ed) Reviewed-on: https://gerrit.libreoffice.org/36453 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3e4e13300db6a0c2c60dbe733d96ff5a7b0d32e5)
2017-04-12Resolves: tdf#107031 writer depends on ACTION_DEFAULTCaolán McNamara1-0/+8
to do its standard "honor the DragDropMode setting" on drag and drop of outline headings into a document Change-Id: Ie154fb237de57ae18fa22d6f50dbf890fb9ebc77 (cherry picked from commit 55e7f73640d754bf0004a0d8a989e0a20de00351) Reviewed-on: https://gerrit.libreoffice.org/36378 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3247dce15d041d178fa2a855b53415a80df16a28)
2017-04-12Resolves: tdf#106725 paint default window bg before spin button bgCaolán McNamara1-3/+9
Change-Id: I0c7f982c3a47f45d022271eba69ebed896288d78 (cherry picked from commit 6f0f2278662e29d054690a85bad6583b5c65f918) Reviewed-on: https://gerrit.libreoffice.org/36097 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 1a9eff02e49c11787810b61b23f1d74b5a9e9952)
2017-04-12PDF export of PDF images: compress page stream if requestedMiklos Vajna2-12/+17
compressStream() automatically takes care of VCL_DEBUG_DISABLE_PDFCOMPRESSION, so this also simplifies code. Change-Id: I7661123e6ba73f8f064ec0543a03e2ec15fd2468 Reviewed-on: https://gerrit.libreoffice.org/36415 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 54a4121f2040bd11f3d6056767f2d7ad6c7745ac)
2017-04-12Related: tdf#106972 vcl PDF import: downgrade PDF >= 1.5Miklos Vajna3-37/+109
There are two problems with these newer PDF versions: - the current PDF export code doesn't know how to roundtrip such PDF images (needs work on both the import and export side) - upgrading the default PDF export version would upset readers who can't parse PDF >= 1.5 So instead of raising the default PDF export version, for now just be conservative and depend on pdfium to downgrade the PDF image version to 1.4 if it would be higher. Given that this modifies the input of the graphic filter this also needs changes in the ODF export, so that the filter result will contain that downgraded data, not the original one. Reviewed-on: https://gerrit.libreoffice.org/36413 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 37bdf1659ddb11d8706289511623cc7c8b0d264b) Conflicts: vcl/source/filter/ipdf/pdfread.cxx Change-Id: I1efa97af8110e9a6ee3e8a7339bcc7d70457cfb0
2017-04-12tdf#107089 PDF export of PDF images: handle mixed filters of page streamsMiklos Vajna3-11/+65
It's allowed to compress different page streams differently, and we must have a single object stream for our form XObject, so just incompress all of them to be consistent. Change-Id: I7a20dc2084a902a37dcefa3420d59a576f120bcd Reviewed-on: https://gerrit.libreoffice.org/36409 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 9e8598c42a1a6f2fbd88711aa9bea5961eaf7b4a)
2017-04-12Related: tdf#107013 PDF export of PDF images: improve content streamsMiklos Vajna1-64/+71
It can happen that the list of content streams have an equal number of "q" and "Q" operators when all of them is parsed. This means it's not correct to represent these separate streams with separate form objects, as those require equal number of "q" and "Q" operators by the end of each object. Instead concatenate the streams and always write a single form object, not only in case there is a single content stream. Change-Id: I62e4ee4c86403376155d10447404416686c84ef9 Reviewed-on: https://gerrit.libreoffice.org/36385 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit a876f982a56c0bcc04667d55a53b05c90a8c3354)
2017-04-12tdf#107018 PDF export of PDF images: handle references in nested dictionariesMiklos Vajna4-22/+65
Also get rid of the GetKeyOffset() and GetKeyValueLength() calls when copying dictionaries: the reference already knows its offset and length, so no need to call them. This makes the dictionary and the array handling more similar. Change-Id: I65936acfaf857636a8d83da3a4cec69289eb89d8 Reviewed-on: https://gerrit.libreoffice.org/36282 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit ee73747ab58fbbd5039823767693431223c347d3)
2017-04-12PDF export of PDF images: avoid invalid offset for not used jpeg bitmapsMiklos Vajna1-1/+2
I missed the JPEG case in commit 30102ded91b9ecfea172ffc6443154230ee37cbd (vcl PDF export, norefxobj: avoid replacement bitmap, 2017-03-29). Change-Id: If1f74c7873d05d5d7da5eb881626d4e5e535a0a1 Reviewed-on: https://gerrit.libreoffice.org/36272 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 39038a3544d1b42388a15e6098ccad8398e8ef36)
2017-04-12tdf#107013 PDF export of PDF images: handle page tree and content streamsMiklos Vajna4-123/+165
Handle when the page objects are not contained in a single list, but a tree of "pages" objects. Also handle when the page object has multiple content streams. Change-Id: I7c5b0949314768af5915d37830a45e843e629446 Reviewed-on: https://gerrit.libreoffice.org/36256 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 4db4b9f016256fc8d2b637ed7a8f2b097aaa864b)
2017-04-07tdf#104686: do not crash if Menu has been somehow disposedAron Budea4-30/+56
The rare crashes in MenuFloatingWindow::ImplGetStartY() and MenuFloatingWindow::ImplScroll(bool) likely happen because of a disposed Menu. Let's guard against invalid accesses. Change-Id: Ie31240abbc48c06edd40d0a95f319725cdb3db16 Reviewed-on: https://gerrit.libreoffice.org/36026 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/36151 Reviewed-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit 9fcb6cb86893b991ceb6395fbabba63c962f59db)
2017-04-06Related: tdf#106972 vcl PDF export, PDF images: ignore PDF >= 1.5Miklos Vajna3-2/+66
When copying their page steam into ours, we need to make sure their syntax is <= 1.4; so when checking if the image has PDF data, ignore the case when it has, but it's >= 1.5 (at least in the default case when not using reference XObjects). Change-Id: I6bd77803b92fe16bdd327e5e7c3d2b42adeacca4 Reviewed-on: https://gerrit.libreoffice.org/36161 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 4443d7be61a9ae45630183d856a566cecd06ad95)
2017-04-06tdf#106972 vcl PDF export, PDF images: handle indirect font referencesMiklos Vajna4-9/+99
There were a number of problems here: - the /Resources key of a page object may be an indirect object - the /Font key of a resource object may be an indirect object - the /Length key of an object may be an indirect object So in all these cases handle not only a direct dictionary / number but also when we have a reference-to-dictionary/number. Change-Id: Ie74371f0ba43a133a1299843ef20cbfc75fe26d7 (cherry picked from commit 242a9b634213acf03cabc373928555dc81afc672)
2017-03-31vcl PDF export, norefxobj: add test for thisMiklos Vajna2-0/+56
Assert two important properties: - the pdf image is described using the form xobject markup (not the reference xobject one) - the form xobject refers to a vector image, not to a bitmap one Change-Id: I94b88976c1e5392758d56254143fbeeeeba51412 Reviewed-on: https://gerrit.libreoffice.org/35901 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 932f6a8f37fbd99fc2ed16aa37966658d388c975)
2017-03-30vcl PDF export, norefxobj: copy each object only onceMiklos Vajna2-8/+17
Even if they are referenced multiple times. This is especially important as objects can refer to each other, creating a cyclic graph. But it also makes the output a tiny bit smaller. Change-Id: I561ac319683a19a797282fe259cc68f3a4c50c3e Reviewed-on: https://gerrit.libreoffice.org/35855 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 92ddc0409c8d3276183afdee543d28e1c307c2c7)
2017-03-30vcl PDF export, norefxobj: avoid replacement bitmapMiklos Vajna1-1/+14
The whole point of "no reference XObjects" is knowing this vector markup is supported everywhere, so no need to provide a fallback bitmap. It was already unreferenced, but now it's not even written to the file, making the PDF export result smaller. Change-Id: Idf766c8eeded4235ebea49d13698a13c6b60f014 Reviewed-on: https://gerrit.libreoffice.org/35841 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 30102ded91b9ecfea172ffc6443154230ee37cbd)
2017-03-30vcl PDF export, norefxobj: add UI for thisMiklos Vajna1-0/+7
Disable the "use reference XObjects" (old behavior) by default, but keep it as an option in case someone wants it. Summary till the help is updated: the old way is simpler code, so it's always correct, but really only Acrobat supports that markup. The new way is supported by all readers, but more complex, so it's more likely it goes wrong. Change-Id: I4769474f29d98412be496a0aa4e8254ae4f0919e Reviewed-on: https://gerrit.libreoffice.org/35826 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 9c944b0d1bff9a0ab1b7e8454c9ac5e7194aa533)
2017-03-30vcl PDF export, norefxobj: have the list of keys to copy at one placeMiklos Vajna1-11/+11
To avoid repeting ourselves. Change-Id: I39667620b9cf391251327c8f66ad8b9649ead36f Reviewed-on: https://gerrit.libreoffice.org/35810 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit f86c3fd8e95f378061d57b77d1c700e076996086)