summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2022-06-01Qt just resize the backing store on size changeJan-Marek Glogowski
... and if there is no need to create a Cairo surface if it doesn't exists, there is no need for a fresh QImage either. Change-Id: If607e03d246f3c31d66953b1e07a7af55659e64b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135209 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-05-31WIN drop effectively empty ImplDrawMenuBarJan-Marek Glogowski
.. as VisibleMenuBar() just always returns false. Change-Id: Ie793d84d57970cbf08b81b6ec0350b9b5fd4192c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135210 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-05-31jsdialog: introduce popup managementSzymon Kłos
Popup windows are managed by vcl (some moving between parents happens on show/hide popup). We need to access correct popup window to correctly close popup in LOK. So remember popup instances. Change-Id: I9e1ba18ded5a1bf675f95bd7178043eebd9bbd5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134576 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135197 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-05-31clang-cl wants VCL_DLLPUBLIC SalLayoutGlyphsCache::clear not to be inlineStephan Bergmann
...to avoid > [build DEP] LNK:CppunitTest/test_vcl_text.dll.d > complextext.o : error LNK2019: unresolved external symbol "public: unsigned __int64 __cdecl SalLayoutGlyphsCache::GlyphsCost::operator()(class SalLayoutGlyphs const &)const " (??RGlyphsCost@SalLayoutGlyphsCache@@QEBA_KAEBVSalLayoutGlyphs@@@Z) referenced in function "private: void __cdecl o3tl::lru_map<struct SalLayoutGlyphsCache::CachedGlyphsKey,class SalLayoutGlyphs,struct SalLayoutGlyphsCache::CachedGlyphsHash,struct std::equal_to<struct SalLayoutGlyphsCache::CachedGlyphsKey>,struct SalLayoutGlyphsCache::GlyphsCost>::removeSize(class SalLayoutGlyphs const &)" (?removeSize@?$lru_map@UCachedGlyphsKey@SalLayoutGlyphsCache@@VSalLayoutGlyphs@@UCachedGlyphsHash@2@U?$equal_to@UCachedGlyphsKey@SalLayoutGlyphsCache@@@std@@UGlyphsCost@2@@o3tl@@AEAAXAEBVSalLayoutGlyphs@@@Z) (Not sure why MSVC itself doesn't complain; maybe LLVM 15 trunk clang-cl accidentally diverges from the MSVC semantics here.) Change-Id: I910fc309f9e02ec0794e449b97ba111d33dcbb54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135199 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-31tdf#117006 gtk: detect High ContrastCaolán McNamara
similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1606038 .e.g. gnome a11y menu, pick "High Contrast" Change-Id: I60643b3a37b722230d5ed47082e4a6491d005ce4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135179 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-30ofz#47664 OOMCaolán McNamara
Change-Id: If0d1ea55a194961fdb05ed2023bcfdaa6f933bfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135129 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-30tdf#147021 Use std::size() instead SAL_N_ELEMENTS macroRoman Kuznetsov
Change-Id: I86956ab4beaba6b2b0905123ccea76c8ffad57fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135063 Tested-by: Jenkins Reviewed-by: Roman Kuznetsov <antilibreoffice@gmail.com>
2022-05-30Related: tdf#89131 draw up/down spins disabled if value is at max/minCaolán McNamara
if there is a max/min set. Change-Id: I2dc7ccccad9ec2aa7eb89d8b5fa137e077a846fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135105 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-29crashtesting: failure on loading gnome635181-1.tiffCaolán McNamara
Change-Id: I5dd9552eb267ffb67aa0aae36b474eb28790b5c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135091 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-29tdf#144601 Qt fix creating QImage with alpha maskJan-Marek Glogowski
Rechecking the QImage documentation, this actually can be easily done; no more bit twiddling, which I got wrong to begin with. LO's alpha mask is inverted to Qt's expectations, but we have invertPixels() and then apply it with setAlphaChannel(). And we can even set the fAlpha using setOpacity()! Change-Id: If2030d3f87d3a4698d1cd9af005d307c2ee63061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135044 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2022-05-28ofz#47673 skip oversized tiff imagesCaolán McNamara
Change-Id: I78727819b7c440855f89240f396dad845a295d61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135041 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-28tdf#149329 Qt change cursor via QWidgetJan-Marek Glogowski
... instead of its QWindow No idea, why my initial implementation used the QWindow. Neither do I know, why it's now somehow broken. The code is called, but the cursor doesn't change. But it seems to work via QWidget, so just do that. IMHO less QWindow is preferable generally; let Qt handle more of the low-level stuff. Change-Id: Id23fba719c9a4d7e760991c51e6021c6f89be345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135051 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2022-05-28tdf#149255 qt: Implement deletion/"swallowing" for IM replacementMichael Weghorn
This implements deletion of the text specified by the `replacementStart()` and `replacementLength()` of the `QInputMethodEvent*` received in `QtWidget::inputMethodEvent`. Quoting from the `QInputMethodEvent` doc [1]: > When receiving an input method event, the text widget has to performs > the following steps: > > 1. If the widget has selected text, the selected text should > get removed. > 2. Remove the text starting at replacementStart() with length > replacementLength() and replace it by the commitString(). > [...] This implementation is sufficient for the scenario described in tdf#149255, but I didn't test any more complex scenarios, like one where text is selected. (My current knowledge of input methods is too limited to be able to do more extensive testing without first spending time to get deeper into the topic.) The gtk3 implementation in `GtkSalFrame::IMHandler::signalIMDeleteSurrounding` was very helpful to get an impression of what needs to be done. Since the documentation for `QInputMethodEvent::replacementLength()` talks about "number of characters", I suspect that conversion to UTF-16 code units is needed just the same way as it is for the gtk3 case and this therefore calls `SalFrame::CalcDeleteSurroundingSelection` the same way. However, this part is untested, since it is not relevant for the tested scenario (where each of the characters is represented in a single UTF-16 code unit). [1] https://doc.qt.io/qt-5/qinputmethodevent.html Change-Id: I2a34e58067e253c39dbd87905943134bdfa4ea27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134855 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-28Move GtkSalFrame::CalcDeleteSurroundingSelection to SalFrameMichael Weghorn
It will be used for qt5/qt6 in a follow-up commit as well. Change-Id: Ic6a9351b0506519010b92e11d30962d5b105ec2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135052 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-05-28tdf#132350 Qt implement SalMenu button interfaceJan-Marek Glogowski
This turned out much more complicated then expected: 1. The QMenuBar needs explicit adjustSize() calls to position a changed corner widget (or a resize...). 2. The adjustSize() results in a temporary, minimal QMenuBar layout, so GetMenuBarButtonRectPixel needs to account for the extra space itself, instead of just a mapTo call. 3. I didn't know, that you can't add shown widgets to a layout, but must call show() after add / insert, otherwise they are ignored in the layout (but show up as the layout items) and are painted in strange positions. This also includes the transparency flags for our QtWidget, so the updater "bubble window" is properly alpha-masked / shaped. And this maybe has too many asserts... Change-Id: I86a708175e9f9be786f5dc1810ae0197a0d3fc39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135021 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-05-27Drop useless text width calculationMike Kaganski
It came from SvTreeListBox::GetHeightOffset dropped in commit 7da765dde1800aa607f96e7a5807582ad2894acb Author Noel Grandin <noel.grandin@collabora.co.uk> Date Thu Oct 27 10:21:42 2016 +0200 loplugin:expandablemethods in svtools Possibly the calculation was used for something else GetHeightOffset used before. Change-Id: I2a13035e0852637529c40a0ffe1bd0e2b8b3d077 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135010 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-27tdf#147844: Use sanity check only if LibreOfficeKit is activeXisco Fauli
Regression from 2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b "Add sanity check to avoid potential crash in the Collabora Online server" Change-Id: I2fcfb634b47f9d76f8efbbd64a8e69ea236894c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135024 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-26unittest for SalLayoutGlyphsCache glyphs subsetLuboš Luňák
Change-Id: I341871c65e63f37ffc3507daaefe035f6762e62b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134956 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-26do not use glyph subsets if LTR/RTL does not match (tdf#149264)Luboš Luňák
Writer apparently sometimes asks to lay out RTL text as LTR, for whatever reason, and Harfbuzz in that case does not give consistent results usable for creating subsets of glyphs (or maybe HB_GLYPH_FLAG_UNSAFE_TO_BREAK is not reliable in that case). I don't quite understand what the problem here is, but avoid it by checking whether the text is LTR or RTL and simply do not try to create a subset from the glyphs if the text does not match the way it was asked to be laid out. I don't even know if this is correct handling or just a workaround for something. Change-Id: Ic77db04f529c9ca2c194893a2127e85953accf32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134950 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-26test also SalLayoutGlyphsCache in glyphs caching unittestLuboš Luňák
Change-Id: Ic0e5ea44525e7cf76a6de1f64f77b943b8347dfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134948 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-26check GlyphItem equality properly in a unittestLuboš Luňák
I.e. use the existing operator==. I don't feel like writing operator<< for it just for one unittest though. Change-Id: I63181765a4987a5d6efedc74a1e20d56a70eaa83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134947 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-26ofz#47617 don't skip TIFFClose on error conditionCaolán McNamara
Change-Id: Ie5a84488312b9f17733747942e45d767cd5d4966 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134928 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-25don't try glyph subsets if cloneCharRange() would return anywayLuboš Luňák
A small optimization. Change-Id: I21786ce713bd39d14c075a941d83c060d04b8886 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134949 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-25Revert "verify that all results from SalLayoutGlyphsCache match"Luboš Luňák
For now at least, as this is causing a number of Jenkins Mac failures, even though it originally passed (and still occassionally does). This reverts commit 04a36851aab1272c9c21ac97d0fc0f4ffe372fe0. Change-Id: I21454b6ec59e96dfb5f6eb723d4eb8f19948d195 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134955 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-25tdf#148864 Qt switch QtObjectWindow to QWidgetJan-Marek Glogowski
... and therefore rename it to QtObjectWidget Replacement of the QWidget with QWindow originally happened in commit 56b19f9a814ae5a39ed760ee542d715493cd0bf3 ("tdf#121247, tdf#121266 KDE5: Add basic support for OpenGL"), but that unfortunately has a very sparce commit message with no reason for this change. Then the code was further complicated in commit 25edbded9946801effd117b9c46de0f8b4bc5632 ("tdf#125517 Qt5 implement a minimal Qt5ObjectWindow") and a few follow up fixes to restore input and focus handling. But appearingly all this QWindow handling isn't necessary and just returning to a QWidget based class fixes the problems with the video overlay (AKA QWidget::winId()) and video playback for good. The OpenGL Impress transition (Fade) mentioned in the original tdf#121266 bug still works. This also adds the previously missing SolarMutexGuard to all the overridden QtObjectWidget functions, which call the SalObject's Callback function. I accidently triggered a DBG_TESTSOLARMUTEX crashing Impress while debugging this. Change-Id: Ia22cabfd4f3585dc7fa3f9f18a913c5bd1987dd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134864 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2022-05-25cid#1504535 Uninitialized scalar fieldCaolán McNamara
Change-Id: I354e6ccc118ec20649eac5257375e493c8172dfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134925 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-25ofz#47587 TimeoutCaolán McNamara
Change-Id: Ic2e168020ad9040705fbdcd0b6945c6a2d2f5b8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134884 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-25tdf#149068 put a OpenGLZone around the sync indirect opengl callsCaolán McNamara
to get the opengl version Change-Id: Ibd55974a39d9d79c9ec9a03e4d4482e4e8755471 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134924 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-25verify that all results from SalLayoutGlyphsCache matchLuboš Luňák
The code used to do it only for computting glyph subsets, but some of the failures there show that bugs in font code elsewhere can make the cache returning different results, so check even for normal repeated cached calls. Change-Id: I8a18710546fe2557f69aaef4ab0bdb63c62a9253 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134659 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-25VCL SysEnvData: add Invalid Platform and ToolkitJan-Marek Glogowski
I accidently almost introduced some subtle sytactic error in Qt, because the default platform and toolkit values are actually valid. So add an Invalid value to both enum classes and then sprinkle some asserts, so these tests aren't working on invalid data. Thanks Michael Weghorn for catching this in review. Change-Id: Ic6a0764dfc5168181251023f4d1c66ffa32651d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134882 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-05-25tdf#125925 Qt migrate KF5 theme font settings codeJan-Marek Glogowski
Currently all implemented Qt platforms use freetype and fontconfig to handle the font selection, so just move the font styling code from the kf5 VCL plugin to qt. This really minimizes kf5 by just keeping the special file picker handling in that VCL plugin. Change-Id: I0bbb2496379396afc46e34fe0d026702dce1492e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134862 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2022-05-24ofz#47591 avoid OOMCaolán McNamara
Change-Id: Ic36cae516177d58a2bbf34a1afc2f843cdc431d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134868 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-24ofz#47589 can't avoid passing in an output in the general case after allCaolán McNamara
there's a flip case which assumes the dest buffer is available, so the 'ALTERNATE RASTER FORMATS' case of man TIFFRGBAImageGet isn't as useful as it looked initially. This reverts commit e912a446210fdae61be3fc04d20d90488cedcdf6, etc Change-Id: I09a614a5469c8996f93af103581099242747fd7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134866 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-24modernize and improve PropertySetInfoNoel Grandin
(*) use o3tl::span for the array param, which means we don't need a null entry to terminate the array (*) use std::unordered_map to speed things up (*) mark the array as static at a few more call sites Change-Id: I05b6cae7552f44459e183ec05cb94e60edb3bfe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24do not use ubidi_setLine() for text runsLuboš Luňák
As far as I understand this, the setLine() is meant to be called for every line in the paragraph set by setPara(), but - our text layout API does not say this in any way, it may be kind of assumed that a substring is a line in a paragraph, but it's not a given, as we call layout functions also e.g. for underlined parts of the text - as I understand it after looking at the source of that function, it really just changes processing to work on a subset of the paragraph, so all it seems to do is to prepare the whole text once with setPara() and then reuse that with repeated calls to setLine(), so it's basically just an optimization, but here using setPara() on the entire string actually should make it slower by processing parts of the string that are not used - if the substring contains some control characters that may be interpreted as going to the next paragraph (#moz147714-1 does this with 0x1e record-separator character), then setLine() will fail because it will not consider the substring to be in just one paragraph and there will be no run detected Change-Id: Ided1d777f086f7905732b408e845405db0163e49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134763 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-24move the comment around a bitCaolán McNamara
Change-Id: I784534285baa5e68f8d8877c6a5fe8c10e5eb429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134843 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-24tdf#149206: Add EMF test in GraphicDescriptorTestofftkp
Add a testDetectEMF test case in GraphicDescriptorTest.cxx that tests GraphicDescriptor for EMF detection and that the size metadata were fetched. Change-Id: I6fbe082bea4d5f1e8660b43a923a09bfcdf466b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134845 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-05-24tdf#149206 Set size correctly when loading EMFofftkp
Regression fixed, rolled back ImpDetectEMF function to version before https://gerrit.libreoffice.org/c/core/+/132456, changed type detection from extension checking back to magic number checking. Also added a small uncompression at the start to keep EMZ support. Change-Id: Id4489da399a571c4c72ce137f841614f5c0d7bdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134703 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins
2022-05-23Removed duplicated includeAndrea Gelmini
Change-Id: I66e5f8ec9cb3d2c590bbd23c173f7028c23ce241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134807 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-05-23don't use glyph subsets with complicated LTR/RTL setupsLuboš Luňák
This should be a more generic solution for problems of some characters having neutral direction (spaces, commas, etc.) and ending up with different RTL flag depending on exactly what subset of the string is wanted (e.g. a space on its own will end up treated as LRT but if surrounded by RTL text then it'll be flagged as RTL too). Previous attempts 5d02daa5198d5bff9234d5db698e934a5e31c95f and 467f2c50a935efff6ff8911e7282ecea535665a3 still left some corner cases, and it seems that simply requiring BiDiStrong and matching LTR/RTL for this optimization covers the usual cases. Change-Id: I9824ba7ac52750d0a933e8ad818f809b8520ec87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134824 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-23gtk: fix leak in treeview tooltipCaolán McNamara
Change-Id: Ib268729abf501da7e9f217ac3c3700cd853dfd43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134815 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23Bad hack to silence UBSan nullptr-with-offsetStephan Bergmann
...since e912a446210fdae61be3fc04d20d90488cedcdf6 "tiff: use more complicated apis to need a smaller buffer during read" in CppunitTest_vcl_filters_test, > [_RUN_____] TiffFilterTest::testCVEs [...] > tif_getimage.c:998:21: runtime error: applying zero offset to null pointer > #0 0x7f487da9d408 in gtStripContig /workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:998:21 > #1 0x7f487da97c27 in TIFFRGBAImageGet /workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:512:12 > #2 0x7f487bd1a56c in ImportTiffGraphicImport(SvStream&, Graphic&) /vcl/source/filter/itiff/itiff.cxx:219:19 > #3 0x7f485d820126 in TiffFilterTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) /vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:70:12 > #4 0x7f485a49ffa0 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:132:20 > #5 0x7f485a4a3a52 in test::FiltersTest::testDir(rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) /unotest/source/cpp/filters-test.cxx:157:5 > #6 0x7f485d8206f9 in TiffFilterTest::testCVEs() /vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:76:5 (<https://ci.libreoffice.org/job/lo_ubsan/2406/>). (If UBSan or some other tool starts to flag this too, we'll probably need to pass in a nullptr after all and teach libtiff to treat that case specially and not advance it.) Change-Id: I4477e6c7036c3c5f2782c2c90c612d98fee60468 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134822 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23tiff: reverse row pixels for ORIENTATION_LEFTBOTCaolán McNamara
and rotate e.g. novell600797-1.tiff Change-Id: I03edcc44f86a40f3e005bec1d8b82a0a89cad276 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134817 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23crashtesting: we can have negative skewCaolán McNamara
which is used to fill rows backwards Change-Id: I07543a622b9566a1a4a8e85c72302545600916c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134816 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23tiled tiff found at rhbz552360-2.tiffCaolán McNamara
fix up wrt skew and buffer size and the right put function Change-Id: Iff93876c39213668f38ba341e597741b695b47bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-23vcl: GCC12 says fclose() causes -Werror=use-after-free on any use of FILE*Michael Stahl
In file included from vcl/inc/unx/cpdmgr.hxx:34, from vcl/unx/generic/printer/cpdmgr.cxx:25: In member function ‘size_t psp::FPtrHash::operator()(const FILE*) const’, inlined from ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, _Unused, __cache_hash_code>::_M_hash_code(const _Key&) const [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _ExtractKey = std::__detail::_Select1st; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; bool __cache_hash_code = true]’ at /usr/include/c++/12/bits/hashtable_policy.h:1268:18, inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::_M_erase(std::true_type, const key_type&) [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ at /usr/include/c++/12/bits/hashtable.h:2358:43, inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::erase(const key_type&) [with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>]’ at /usr/include/c++/12/bits/hashtable.h:971:24, inlined from ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::erase(const key_type&) [with _Key = _IO_FILE*; _Tp = rtl::OString; _Hash = psp::FPtrHash; _Pred = std::equal_to<_IO_FILE*>; _Alloc = std::allocator<std::pair<_IO_FILE* const, rtl::OString> >]’ at /usr/include/c++/12/bits/unordered_map.h:763:26, inlined from ‘virtual bool psp::CPDManager::endSpool(const rtl::OUString&, const rtl::OUString&, FILE*, const psp::JobData&, bool, const rtl::OUString&)’ at vcl/unx/generic/printer/cpdmgr.cxx:725:28: vcl/inc/unx/cupsmgr.hxx:35:43: error: pointer may be used after ‘int fclose(FILE*)’ [-Werror=use-after-free] 35 | { return reinterpret_cast<size_t>(pPtr); } | ^ vcl/unx/generic/printer/cpdmgr.cxx: In member function ‘virtual bool psp::CPDManager::endSpool(const rtl::OUString&, const rtl::OUString&, FILE*, const psp::JobData&, bool, const rtl::OUString&)’: vcl/unx/generic/printer/cpdmgr.cxx:695:15: note: call to ‘int fclose(FILE*)’ here 695 | fclose( pFile ); | ~~~~~~^~~~~~~~~ Change-Id: Ib035f2287649dcf9a2d37bda85ebcf52c6c51aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134739 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23vcl: WhitespaceToSpace() spurious -Werror=maybe-uninitializedMichael Stahl
vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized] Change-Id: I37250b0790bd9c33eb01c552c8267251bc0026f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134738 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-23handle RTL space in non-RTL layout in SalLayoutGlyphsCacheLuboš Luňák
Reproduced with tdf#95217-1 on the crashtesting server. Change-Id: I44dfa762b624ca24a8bd4ce8df03f8c870d4e7c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134755 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-05-22for fuzzers add libtiff to common externals, not just tiffuzzerCaolán McNamara
Change-Id: I747a39a26c446000924a1d48c5d650fac330216e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134746 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>