summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2021-04-27tdf#141761 Enhance PrintDialog Preview for FormControlsArmin Le Grand (Allotropia)
The display quality of the Preview is pretty ugly when FormControls are used. I made a deep-dive why this happens, and in principle the reason is the Mteafile::Scale used below. Since Metafile actions are integer, that floating point scale leads to rounduing errors that make the lines painting the FormControls disappear in the surrounding ClipRegions. That Scale cannot be avoided since the Metafile contains it's own SetMapMode commands which *will* be executed on ::Play, so the ::Scale is the only possibility fr Metafile currently: Giving a Size as parameter in ::Play will *not* work due to the relativeMapMode that gets created will fail on ::SetMapMode actions in the Metafile - and FormControls DO use ::SetMapMode(MapPixel). This can only be solved better in the future using Primitives which would allow any scale by embedding to a Transformation, but that would be a bigger rework. Until then, use this little 'trick' to improve qulatity. It uses the fact to empirically having tested that the quality gets really bad for FormControls starting by a scale factor smaller than 0.2 - that makes the ClipRegion overlap start. So - for now - try not to go below that. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114704 Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 4722ad2cf3f2b91c217e3548f811f2972f2aa60c) Change-Id: I540de602634c6afa697b5659d69c34159c22075c
2021-04-22tdf#141761 Avoid vanishing FormControlsArmin Le Grand (Allotropia)
For details see task documentaion, but BG is that a Rectangle gets not transformed in OutputDevice::LogicToPixel and corresponding methods of OutputDevice due to the given Rectangle.IsEmpty() == true. This ignores that the Rectangle has a valid position and that we have cases where a Rectangle is used to hold a Position without having a Size != 0 in X and Y. Thus I added transforming the Position in these methods in all cases - a Rectangle always has a valid position - and take care of Sizes that exist. This *may* need to be done different due to old hiccups of Rectangle itself, see explanation at OutputDevice::ImplLogicToDevicePixel Had to do it different now, see comment in map.cxx for expalantions. Also needed to adapt the ancient optical geometric paint position correctionsfor Buttons - these can get zero or negative due to using Zoom and MapMode settings. A Width shoul not get zero or negative. Adapted to work branch. Was some work, in map.cxx all the transformations have changed, even the number of parameters for ImplLogicToPixel. Also in button.cxx pretty dangerous - initial merge offers the conflict solutioin at the wrong place due to the code in question did move in master to a unified position. Change-Id: Ide085fbe74f9c0387de3c1bf6320b7e873238029 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114304 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-04-09ofz#26122 allow NINSIZE input full elementsCaolán McNamara
Change-Id: Ifbde8fc055a91e23db08508a34ce4664d2f1f96f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit fb0c3f9d8964f8c0f40238559c32d9d73cba6b55)
2021-04-09ofz#25989 cmap parsingCaolán McNamara
Change-Id: I048e5d88d5926a4afa75afab18db5ca6354e2454 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103641 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9a1202edab0cfe95572f12a8c49ef756ead49bf2)
2021-04-09ofz#25684 keep ParseCMAP within legal areaCaolán McNamara
Change-Id: Iee18b5a9390b79efa67414ea2d229d2816c84e18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102776 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit a014c82522834c972e247a28d8e5f42998ae3c0e) ofz#25696 OOM Change-Id: Ia69e9ce1ca0156e960dddb7e0bf98dfd2be2d7cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102846 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit d57b14e3394b081adf0888ed8dcb7b86d66c246c) ofz#25774 keep ParseCMAP within legal area Change-Id: Ic68fadd3d63631cbccda76e7679d95bb89452d25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103017 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f8474367449a1b6b54918d2753e3a36798761839) Fix crash from broken font CMAP subtable ParseCMAP crashes on a broken CMAP subtable of a font used by the bugdoc of tdf#119074, which returns a negative offset (technically it's large positive offset turning into a wrong negative integer, which is still out of bounds of the CMAP overall size - you get the point). This simply ignores that broken subtable, checking for other existing ones. Regressed-by: c7482bc2904401e7d975b5721ec861b8589253f9 Change-Id: I95820fe3bb6bd2fe2e0cf9d4c3536abce31fd497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103033 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9bf4c5ac49b73cc2a8c89a87ff87238c061a579d) Missing include (for std::max, since f8474367449a1b6b54918d2753e3a36798761839 "ofz#25774 keep ParseCMAP within legal area") Change-Id: I873c788577e9ec3bd54d9e637d2cf86be7c1f6e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103089 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 8cc52b05744443c64cf5eb62ebe3098cd964c437) ofz#25855 overflow in nTmpOffset we already know nLength is >= 24 so just move the calc to the other term Change-Id: Ic52f1686ccf81e6b13d7eb7e74dbd9cb51c8ea01 ofz#25868 Timeout, encoding conversion only sane in 0..SAL_MAX_UINT16 range so ignore points outside that range to avoid ludicrous ranges that aren't possible in the input encoding Change-Id: Ifb7b9b389d4a31b8820a7da661249223fe1e110c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103261 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 1e41300a9552f90b3d75d5ffadd31ae42a28d249)
2021-04-09cid#1209863 Untrusted loop boundCaolán McNamara
Change-Id: Ic8d20e92b4021dfebe01e1265c3afb2bcd509827 Reviewed-on: https://gerrit.libreoffice.org/76259 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 52b92a591943c1988fd3d660bd6fc5ac53ce0f33)
2021-04-09cid#1209863 Untrusted loop boundCaolán McNamara
Change-Id: Ie9c3672a065b9df4580559cd927c6b1524edde0e Reviewed-on: https://gerrit.libreoffice.org/76099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit a6eaacf66ccc8f83b075b775f4dfa0aace0c3e3a)
2021-04-09rename search+replaced Getsal_uInt16 result back to GetUShortCaolán McNamara
Change-Id: Ia6e35d0ca15b0ac2310ad847c6eda6db548b25f6 Reviewed-on: https://gerrit.libreoffice.org/76258 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 63922db083dc70c9b248c9eb34b24382048adf08)
2021-04-09vcl: removed unit test added during pdfium updateVasily Melenchuk
Testcase was modified during pdfium update to 4021, but corresponding feature is not implemented in 6.3 yet, so better to remove that testcase completely as in original 6.3. Change-Id: Ia26c5717385fc95227d1d46f8df4a8b333ed7a05
2021-04-09external: update pdfium to 4021Miklos Vajna
Change-Id: I1c3280e811bf65641bf559e3f01bc62e609548f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86811 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Conflicts: vcl/qa/cppunit/pdfexport/pdfexport.cxx
2021-04-09external: update pdfium to 3849Miklos Vajna
Reviewed-on: https://gerrit.libreoffice.org/75736 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 0ee0ca3036629b69bf20b448d74991fd133f08ac) Change-Id: I616f57bd9de72b078500a290bf9ff89c71773f26
2021-04-09xmlsecurity: handle MDP permission during PDF verifyMiklos Vajna
(cherry picked from commit 586f6abee92af3cdabdce034b607b9a046ed3946) Conflicts: include/vcl/filter/PDFiumLibrary.hxx vcl/source/pdf/PDFiumLibrary.cxx xmlsecurity/source/helper/pdfsignaturehelper.cxx Change-Id: I626fca7c03079fb0374c577dcfe024e7db6ed5b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105785 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 00479937dc071246cc27f33fd6397668448a7ed9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107062 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2021-04-09vcl pdf tokenizer: fix handling of dict -> array -> dict tokensMiklos Vajna
Needed to be able to parse the /Reference key of signatures. (cherry picked from commit 056c1284d6a68525002c54bef10834cc135385db) Conflicts: vcl/qa/cppunit/filter/ipdf/ipdf.cxx Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105626 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 8f46af565680bef0ff8ca32781e6d813a7446543) Change-Id: I6b81089a3f58a2de461ad92ca5a891c284f8686a Conflicts: vcl/Module_vcl.mk Change-Id: I6451277f9a0042bd30f66d26dcf4cd16f142e2b7
2021-04-09xmlsecurity: pdf incremental updates that are non-commenting are invalidMiklos Vajna
I.e. it's OK to add incremental updates for annotation/commenting purposes and that doesn't invalite existing signatures. Everything else does. (cherry picked from commit 61834cd574568613f0b0a2ee099a60fa5a8d9804) Conflicts: include/vcl/filter/PDFiumLibrary.hxx vcl/source/pdf/PDFiumLibrary.cxx xmlsecurity/qa/unit/signing/signing.cxx Change-Id: I4607c242b3c6f6b01517b02407e9e7a095e2e069
2021-04-09pdfium: only init pdfium library once and destroy on LO exitTomaž Vajngerl
With more and more usage of PDFium, it is hard to keep track of the life-time of the PDFium library, so it can happen that a FPDF_DestroyLibrary happens when we still have another instance where PDFium is still use. The result of this is a crash. To prevent this, just initialize the library once and delete, when on LO exit. This can be improved in the future to only keep the library active when in actual use. [ Leaving out the vector graphic search bits, the motivation is to just have this in libreoffice-7-0, so that recent pdf sig verify improvements can be backported. ] (cherry picked from commit 067a8a954c8e1d8d6465a4ab5fb61e93f16c26c2) Conflicts: vcl/source/graphic/VectorGraphicSearch.cxx svx/source/svdraw/svdpdf.cxx svx/source/svdraw/svdpdf.hxx vcl/Library_vcl.mk vcl/qa/cppunit/pdfexport/pdfexport.cxx vcl/source/filter/ipdf/pdfread.cxx Change-Id: I5c7e5de7f8b97d10efb394c67c7a61b976c8d57c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102317 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit b7de766b4dc5b4810277069bcf53a9f3737e87da)
2021-04-09tdf#127932 fix wrong page number in print progressJuergen Funk
- in ctor, reset start pages to non-inflated value after size calculation - update label, _then_ progress in setProgress() Change-Id: I66576e339de814922512b68167e6c0a9b1025378 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102031 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 63bf8f042abe3c0f6989f6763d13f5389182b816) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102281 Tested-by: Jenkins
2021-04-09Use idle to update preview in print dlgSamuel Mehrbrodt
Otherwise UI blocks while the preview is being updated Change-Id: I98c536b83a31e9ea3f72effc8a602ee190a81e68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103951 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2021-04-09xmlsecurity: detect unsigned incremental update between signaturesMiklos Vajna
(cherry picked from commit 7468d5df5ec79783eae84b62bdc5ecf12f0ca255) Conflicts: vcl/source/filter/ipdf/pdfdocument.cxx xmlsecurity/source/pdfio/pdfdocument.cxx Change-Id: I269ed858852ee7d1275adf340c8cc1565fc30693 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99382 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-09tdf#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>
2020-03-11Resolves: tdf#131248 a11y crash when closing SQL Edit QueryCaolán McNamara
Change-Id: I39db7b352dd460f46092a054bfa89f5acdda54c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90274 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-03-02tdf#130515 Time field in Base form will not display correct formatNoel Grandin
regression from commit 65b7b6322b662785bf032e66c76abc36c9a2bb0e Date: Wed Feb 8 10:40:28 2017 +0200 loplugin:unusedenumconstants read-only constants in vcl Change-Id: Icf2e385763c8ece34521895331d148a5baacf2d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 9cb07cdca78e2cb1ecff84b7a8e154b23cc2a46d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89796 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-02-28tdf#130071 tdf#127815 qt5: Use ExtTextInput only for multi-char key eventsMichael Weghorn
Only call the SalEvent::ExtTextInput callback for key input events if their text is longer than one character, in which case treating them as SalEvent::KeyInput would produce incorrect results, given that only the first character is set as the SalKeyEvent's mnCharCode below (s.a. tdf#124118). S.a. commit 61c8324394c690ced18ce692ab6d29c8031ad1a8 ("#88063# fixed event handling for redflag", 2001-06-12) which made events with text longer than 1 unicode char to be handled by SalEvent::ExtTextInput for the gen VCL plugin even if not in preedit mode. Process other key events by calling SalEvent::KeyInput callback, which e.g. makes shortcuts involving non-Latin characters (tdf#130071) and auto-insertion of non-breaking spaces when typing French text (tdf#127815) work. The gtk3 and gen VCL plugins also use the length of the text as one criterion to make a disctinction of whether to call SalEvent::ExtTextInput or SalEvent::KeyInput, s. GtkSalFrame::IMHandler::signalIMCommit and X11SalFrame::HandleKeyEvent. Those also take into account whether in preedit mode, but for the qt5 case, input method events when using e.g. ibus are handled in Qt5Widget::inputMethodEvent and the Qt5Widget::handleKeyEvent code path is not used anyway. Change-Id: I2f8925ea26a4fb5419226265c579242889e2a506 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89663 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins (cherry picked from commit 1c6ea413cb01c0b482f87e625ba208eec230618a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89671 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-02-28tdf#130679 Draw: Convert to polygon doesn't workNoel Grandin
regression from commit 1cd32bcf1b92bd53320717626601135623dadd55 Date: Mon Dec 10 11:28:59 2018 +0200 loplugin:useuniqueptr in vcl Change-Id: I7753f54822d0249d1fcda97581051d023969fc2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit dc5be8f6020dd812664af250d03d2a14b9e8a3cb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89585
2020-02-25Resolves: tdf#130762 honour "wrap" in FormattedFieldCaolán McNamara
Change-Id: Iefd9a537aa358eab179cf6f0eeb6f80a9a77284a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89011 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 20c08e47f7c156a4726194215b389f4d0b165904) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88953 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 1c75d4df766098b51221ad20f9f569aff87d1b1b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89280
2020-02-20tdf#130794 qt5: Actually, ignore non-spontaneous QEvent::ShortcutOverrideMichael Weghorn
In fact, the assumption in commit 034f56015c1c7a61faede33fb5306f63b5585632 ("tdf#126785 qt5: Ignore external QEvent::ShortcutOverride") was a fallacy and it's exactly the other way around: "Normal" typing leads to "spontaneous" events of type QEvent::ShortcutOverride, since those originate from outside, are triggered via X11 events or Wayland equivalent, and the non-spontaneous ones are the additional ones that happen when e.g. the Orca screen reader is enabled. In a short test, no non-spontaneous QEvent::ShortcutOverride ever occured when using LibreOffice a bit with Orca disabled on X11 or Wayland (and on Wayland also not with Orca enabled, since Qt accessibility is broken there, s. QTBUG-73945 [1]). (Side note: In a quick test with Qt 5.12.5 and Plasma on Wayland, 'xcbSourceDispatch' from Qt library's qxcbeventdispatcher.cpp was also used in the Wayland case to when processing the keyboard events). [1] https://bugreports.qt.io/browse/QTBUG-73945 Change-Id: I1be1977e67f84fa657f6fc197e0b91822b6a3a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89073 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 69e708868f6046cada955a16bca966370ce3218a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88961 Reviewed-by: Katarina Behrens <bubli@bubli.org>
2020-02-19Resolves: tdf#130756 null deref in empty treeviewCaolán McNamara
Change-Id: Ie43081d5c1feb655ea1479476375ee7381f0a0ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88948 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-17tdf#126785 qt5: Ignore external QEvent::ShortcutOverrideMichael Weghorn
For some reason, an extra external QEvent::ShortcutOverride event is triggered when a key is pressed and e.g. the Orca screen reader is enabled, which would result in duplicated input when handled as key input event as well. Therefore, ignore those ShortcutOverride events that are "spontaneous", i.e. "the event originated outside the application (a system event)". [1] [1] https://doc.qt.io/qt-5/qevent.html#spontaneous Change-Id: Ibccacb69c31d4d7ebd512c704f0e4df978c5281f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88852 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 034f56015c1c7a61faede33fb5306f63b5585632) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88791 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-02-14tdf#130325 Fix listbox used as dropdownSamuel Mehrbrodt
In this case, the listbox is not used as a static widget, also not as a combobox with dropdown. Instead the listbox is placed in a popup to choose values from. Need to handle this case similiar to the combobox dropdown (Cursor movement only travels through items, Return selects one item). Regression from 7de9417d5f65d35227c7f80f6d587c2a56bde4e0 Change-Id: Idadc3da5847e12e1408203b13ab59eb53fe14eea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88581 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit d92463c88a557eea7a439def39659b1409772583) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88504 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-02-12tdf#130555: Prevent negative aSelection.Min()Stephan Bergmann
...which would violate the the preconditions of the later call to maText.remove. When BreakIteratorImpl::previousWord (i18npool/source/breakiterator/breakiteratorImpl.cxx) is called to e.g. move back over a single space at the start of the text, at least for an en-US locale it will fall through to the call to BreakIterator_Unicode::previousWord (i18npool/source/breakiterator/breakiterator_unicode.cxx) at the bottom of the function. That in turn calls icu::BreakIterator::preceding, which is documented (workdir/UnpackedTarball/icu/source/common/unicode/brkiter.h) to return icu::BreakIterator::DONE (i.e., -1, see workdir/UnpackedTarball/icu/source/common/unicode/brkiter.h) in that case, which causes BreakIterator_Unicode::previousWord to return a Boundary with startPos == endPos == -1. The documentation of UNO method css.i18n.XBreakIterator::previousWord (offapi/com/sun/star/i18n/XBreakIterator.idl) is silent about the expected return value in such a case. But lets assume that returning such a [-1..-1] Boundary is as intended, and locally address this case in Edit::ImplDelete, making aSelection start at the start of the text. Change-Id: I40e17ba602088e72aa6962cb41dd8e1cdf6e2561 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88431 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit e8f26dc13b65b1a05d948d9c95110c86315e8f20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88403 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-02-10tdf#129809 qt5: take a reference in case m_aContents is replacedMichael Weghorn
This takes over Caolán's solution for gtk3 from dbcdc5cd98df5756a96559e467cad95c629343ca ("tdf#129809 take a reference in case m_aContents is replaced") for the qt5 case as well, to prevent that the XTransferable is destroyed along with the Qt5MimeData object as new QMimeData are set in the clipboard, as follows: 1 Qt5Clipboard::setContents Qt5Clipboard.cxx 2 TransferableHelper::CopyToSelection transfer.cxx 3 TransferableHelper::CopyToSelection transfer.cxx 4 SwTransferable::CreateSelection swdtflvr.cxx 5 SwWrtShell::SttSelect select.cxx 6 SwWrtShell::SelectTextAttr move.cxx 7 SwTransferable::GetData swdtflvr.cxx 8 TransferableHelper::getTransferData2 transfer.cxx 9 TransferableHelper::getTransferData transfer.cxx 10 Qt5MimeData::retrieveData Qt5Transferable.cxx 11 QMimeDataPrivate::retrieveTypedData qvariant.h 12 QMimeData::data qmimedata.cpp 13 QInternalMimeData::renderDataHelper(QString const&, QMimeData const *) 14 ?? 15 ?? 16 ?? 17 QXcbConnection::handleXcbEvent(xcb_generic_event_t *) 18 QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) 19 ?? 20 g_main_context_dispatch Change-Id: Ic712c901a31131efc596cac7f00f14bb6a7ce068 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88192 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 1d7b1a15059a77fde9afa14d0b9a508142bfc247) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88259 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-02-08tdf#129809 take a reference in case m_aContents is replacedCaolán McNamara
Change-Id: I36ae74b6b3424bd2f0b71bc54838ec39e504b6d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88180 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2020-02-04Related: tdf#129933 assert on pasting over selection in editCaolán McNamara
when its selected right to left with cursor flashing at the start format->paragraph->area->color->pick, cursor into hex# edit, end to cursor at the end, shift + home to select all, right to left, ctrl+c, ctrl+v, assert Change-Id: I8e29108ddff94487c298bd5e6607b98f5f841afd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87886 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-09tdf#129662 vcl: rtl: fix scrollbar in dropdownsMiklos Vajna
Regression from commit d4714b0fdb81e6e561ae526cc517ecc9a40a603e (tdf#101978 vcl combobox/listbox floating window: avoid flicker, 2019-06-17). High-level vcl double-buffering never set up RTL status of the virtual device correctly, but now that double-buffering is used at more places, this got noticed. (cherry picked from commit b0fa356eed82a0452e6bcb915f179f5e2d02943a) Conflicts: vcl/source/window/cursor.cxx Change-Id: Iba378cef3a693b0712389fab519f38ee222577d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86158 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86487
2020-01-07tdf#129490 Fix enter key in combo boxSamuel Mehrbrodt
Follow-up fix for 7de9417d5f65d35227c7f80f6d587c2a56bde4e0 Change-Id: I0b05f11b79d5fcd4e4823c1e31c087724ebc85f8 Reviewed-on: https://gerrit.libreoffice.org/85748 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 09c0dc8b80b91a4f2e7ad3569a59402ee131eaf4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85835 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-01-02focus-in/out should return a valueCaolán McNamara
Change-Id: I82df9b24a5f08830eda1e511d6a7d45a1edcc08e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85499 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-23tdf#127022 vcl: fix Windows RTL menu barMiklos Vajna
Regression from commit e8d5b8beb5958147235ff955ed38c47b51d860ff (tdf#113714 vcl menu bar window: avoid flicker, 2019-05-20), the problem was that while the original render context has RTL set up correctly, the intermediate virtual device had it disabled all the time. Change-Id: Ic063c4a6c0537891c0bfceb8927edb97cf1c6e86 Reviewed-on: https://gerrit.libreoffice.org/85624 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/85636 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/85735
2019-12-23Resolves: tdf#129484 just install decimal key handler for spinbuttonsCaolán McNamara
as a simple interim fix Change-Id: I7e393fe20f4fb7ea277c423f9fc9789d658b1e18 Reviewed-on: https://gerrit.libreoffice.org/85507 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-16tdf#129043 Correctly deliver combo box events when used with keyboardSamuel Mehrbrodt
Change-Id: I82186f999e74be4aebd59d77666390a7d5e8ad81 Reviewed-on: https://gerrit.libreoffice.org/83923 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 7de9417d5f65d35227c7f80f6d587c2a56bde4e0) Reviewed-on: https://gerrit.libreoffice.org/83982 (cherry picked from commit e9ced64ffac0752e2bbd2879ea267116502606fc) Reviewed-on: https://gerrit.libreoffice.org/85200 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-12-12tdf#123076 Get paper size for print previewGabor Kelemen
Initialize from current paper size which can be different from A4 Change-Id: Iae5e33d79c0783a32dad8635a66cc3fbe83dc568 Reviewed-on: https://gerrit.libreoffice.org/84920 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 562c30d5ad142fcdc77be6125fdac6d48b782fd7) Reviewed-on: https://gerrit.libreoffice.org/85057 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-12Resolves: tdf#128867 support LocalizedDecimalSep for native gtk dialogsCaolán McNamara
Change-Id: Idb883707fb89d1f76b24ea592c51e28fffd2322f Reviewed-on: https://gerrit.libreoffice.org/84954 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-12-09tdf#122706 Fix built-in HID on Print dialogs Help buttonKelemen Gábor
to open the general Print page. Reviewed-on: https://gerrit.libreoffice.org/84628 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 46a07f2042a812fc552e26736183c7d06fe6aa35) Reviewed-on: https://gerrit.libreoffice.org/84735 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Change-Id: I1ffee4a9d72bb6a4840dec3800a397a878ed2eca Reviewed-on: https://gerrit.libreoffice.org/84738 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-06tdf#128992 Compressing PNG files with alpha channel get a black backgroundNoel Grandin
regression from commit d4442ac1ac9aae36dbc08fda8154d71ea0f81708 Date: Wed May 30 13:02:25 2018 +0200 drop Graphic::GetBitmap Change-Id: I937f89255eebc68dffc2987e628a30bc7d2eed7b Reviewed-on: https://gerrit.libreoffice.org/84412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 1187e2b35bb864808d9d158f0b10d83ce75dbaa7) Reviewed-on: https://gerrit.libreoffice.org/84428 (cherry picked from commit 54a4c75bd35ba684927862f4e859623e91ebcfe8) Reviewed-on: https://gerrit.libreoffice.org/84542 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-12-05get_active should be true when activated but menu not yet shownCaolán McNamara
Change-Id: Ia2a7cbf5b47eab6d09c78eb9d18233e18b628a3f Reviewed-on: https://gerrit.libreoffice.org/83906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit f8719f68f8c073c0ad473507b16fc4bd99e79baa) Reviewed-on: https://gerrit.libreoffice.org/83987 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-11-27tdf#126607 Qt5 activate window before setFocusJan-Marek Glogowski
.., and prevent Qt5MainWindow to take any focus. Our top level Qt5MainWindow shouldn't handle focus directly, as it's always completely drawn by the child Qt5Widget, which also handles input. So prevent any direct focus handling by setting the Qt5Widget as the focus proxy of the Qt5MainWindow. Also setting the focus of the child widget on its own seems to do nothing at all. At least I didn't see any difference after commenting the code block. But it at least has some effect, if you call setFocus on the real window, but that breaks Impress full screen mode, which somehow gets scroll bars?! Not that I understand why this is needed. At least the original X11 code just calls XSetInputFocus in this case. Change-Id: I591c031a17a7ae0b5486760cd1802522d4088678 Reviewed-on: https://gerrit.libreoffice.org/83689 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit ec554ac30236fa7949e9866d01319d4e3e88c983) Reviewed-on: https://gerrit.libreoffice.org/83895 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-11-27tdf#127403 Revert "VCL keep / return the original set TextEngine font"Jan-Marek Glogowski
This reverts commit cc223fa12a61ba0e580b884386a7f5d7efd0541f. All the other attenps to fix this seem to cause timeouts in the Jenkins clang_dbgutil build. I don't have one around and no time to investigate further, so let's see, if the revert passes. Change-Id: Ib915185eaf79073523351705baf28df3c62906f1 Reviewed-on: https://gerrit.libreoffice.org/83654 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit b1e73fd49661e07e6085310f3f6ecc6ade2a3762) Reviewed-on: https://gerrit.libreoffice.org/83827 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 13d777a0aa3802871cf01869d904ceec39096024) Reviewed-on: https://gerrit.libreoffice.org/83873 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-26Reload Notebookbar, when customization is being done.Sumit Chauhan
This patch is related to notebookbar customization tab. When one clicks the widget checkbox , to preview the real-time changes one need to call this ReloadNotebookBar() method . Reviewed-on: https://gerrit.libreoffice.org/73750 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 6b888ac476fe6ac2ee96c7086cb8c24249f08473) Change-Id: I3d6314e4b8220a8744331246639acadea941252f Reviewed-on: https://gerrit.libreoffice.org/82737 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-25tdf#128820: use wps namespace for simple text shapesMike Kaganski
Without that, simple text shapes inside groups were written in <pic:wsp> elements, with many child elements also having pic:: prefix. Change-Id: I114cf3499e03aa5ca042211d7b134aaf5b0e7fbf Reviewed-on: https://gerrit.libreoffice.org/82980 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Also consider saved exceptions when terminating parse As with previous commit 18ae77a065cb8ae6940d4067f6ab7e99a3f74047, this will start showing parse errors on invalid files which previously just opened without warnings, silently losing the invalid stream part. Any bug bisected to this commit is not a regression from this commit! The real problem was already before, and was just disclosed by this (which is the actual goal). Also simplify unit test data for tdf#128820, which will now be enough after the change. A unit test (testN779627) revealed unexpected throws when parsing; this was fixed. Change-Id: I5a21b9001874ec6e3b8273c10043ef930bf1cc82 Reviewed-on: https://gerrit.libreoffice.org/82981 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> tdf#128820: improve unit test to not depend on opening bad file failing ... also test exported XML directly Change-Id: I50237593dd111e7c7974452769c8d49c22012713 Reviewed-on: https://gerrit.libreoffice.org/83005 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Fix UBSan build after 9fdf8c0a5cc036ea9bd1e11dd8f2c1a6e601fae2 The said commit simplified a testdoc to testTdf128820, using a smallest possible SVG in it. This seems to produce the smallest possible PNG of size 8, which is passed into GraphicDescriptor::ImpDetectPNG. There its size is read into nTemp32 past the end of the file without checks, which keeps last value of the variable (which was the magic number 0x0d0a1a0a), which is then saved into the descriptor. Then that value is used in ImpGraphic::ImplGetSizePixel, and later multiplying it in lclConvertScreenPixelToHmm causes UB. Fix by checking all the reads in GraphicDescriptor::ImpDetectPNG. Change-Id: Ib4740fac2b87fbef57d5150151129b9852f3ecb8 Reviewed-on: https://gerrit.libreoffice.org/83119 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/83296 (cherry picked from commit d54bae3471e9b9529f1ac03c811c3370d9f5ed89) Reviewed-on: https://gerrit.libreoffice.org/83337 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-25the label sync button will relaunch itself from its close handlerCaolán McNamara
so rearrange things so that runAsync can survive that Reviewed-on: https://gerrit.libreoffice.org/81884 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 60692ba238c6c5c003722ccaa52702e9ef3ade13) Change-Id: I7d40637fb861ceb64ce32f0e9ecb3451c0d17bad Reviewed-on: https://gerrit.libreoffice.org/83523 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-25assert fires after help hides find & replace dialogCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/80769 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit de2cb96d5f9bb3c831fd136062582b4c11a003d1) Change-Id: I72db53711322de9420fdb097ac60dda35f1ec5d8 Reviewed-on: https://gerrit.libreoffice.org/83522 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-11-21tdf#128434 correctly release fonts in destructorsJan-Marek Glogowski
This adds ReleaseFonts() calls to all destructors of SalGraphics and TextRenderImpl derivated classes, which implement SetFont. During destruction a base class can't call into derivated classes, as these are already destructed, so we have to spread these calls manually. Change-Id: Ia57db04f7df665e5205212ce512119e2f60e3379 Reviewed-on: https://gerrit.libreoffice.org/82967 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit f8e1f8652255cadd80a991aa3e059ee631b333b8) Reviewed-on: https://gerrit.libreoffice.org/83149 (cherry picked from commit a00bdc999344db34d5926dc77ed5ca895295b0ee) Reviewed-on: https://gerrit.libreoffice.org/83197 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>