summaryrefslogtreecommitdiff
path: root/vcl/source
AgeCommit message (Collapse)Author
2024-04-04A number of bogus GCC 13 warnings still hit with recent GCC 14 trunkStephan Bergmann
Change-Id: I0ec7743cd79429591fcfc3eb9715ff36d06fc00b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-02Related: tdf#157480 use SSL_CERT_FILE on macOS tooCaolán McNamara
for SSL use by pyuno emailmerge another alternative mechanism that could work is to generate one with something like: "security find-certificate -a -p > cert.pem" ref: https: //hynek.me/articles/apple-openssl-verification-surprises/ Change-Id: I8bff2ca5bbbb4f2c2333a67e0281dd4fa0b06405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165599 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-02simplify SotTempStream and lifetimeNoel Grandin
It is really just an SvStream instance, and the lifetime does not need reference counting Change-Id: Idb5ffd96f852aae0dc1a94cddc0a83fbcdf974ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165655 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-02Fix UB after 8962141a12c966b2d891829925e6203bf8d51852Mike Kaganski
(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 2024-04-01). As reported by Stephan in https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82: `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now fails with vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the range of representable values of type 'long' #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at vcl/source/gdi/sallayout.cxx:245:30 #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString const&, int, int, int, unsigned long, KernArraySpan, std::span<unsigned char const, 18446744073709551615ul>, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1932:28 #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32 #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString const&, unsigned short) at starmath/source/rect.cxx:224:21 #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at starmath/source/node.cxx:2122:18 #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:1340:17 #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:816:13 #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:610:20 #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at starmath/source/node.cxx:534:20 #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13 #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9 #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21 #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at starmath/source/document.cxx:552:5 #13 in SmDocShell::SetText(rtl::OUString const&) at starmath/source/document.cxx:188:9 #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/document.cxx:848:5 #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at starmath/source/unomodel.cxx:1105:22 #16 in writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30 #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23 #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:114:37 #19 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27 #20 in (anonymous namespace)::RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:163:20 #21 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2392:34 #22 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:760:23 #23 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36 #24 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:720:28 #25 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37 #26 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20 #27 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:308:5 #28 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:168:14 #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:591:16 #30 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62 #32 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19 #33 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5 #34 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:441:20 #35 in SwModelTestBase::loadAndReload(char const*) at sw/qa/unit/swmodeltestbase.cxx:466:5 #36 in (anonymous namespace)::testMathEqarray::TestBody() at sw/qa/extras/rtfexport/rtfexport.cxx:198:5 Change-Id: I857861f5bc51a1e43bfbf5e0c9dbce542d673ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165664 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-01tdf#151413: add UTF-8 data to the Link clipboard formatMike Kaganski
And introduce methods in TransferableDataHelper to handle that. Change-Id: I1d91f0f6b7e8523125f9cc1507dbd6737968f7d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165607 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-01tdf#160436: fix glyph bounds calculation for vertical glyphsMike Kaganski
It is unclear if LogicalFontInstance::GetGlyphBoundRect can be called for both normal and rotated variants of the same glyph in the same font. If yes, then the normal and vertical variants must be cached separately, or possibly vertical variant can be not cached, but always calculated. This problem already existed before, so this change doesn't introduce a new issue. Change-Id: I9b50ef340c9e38db7bef890165519aadc96d3ffa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165581 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-01tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangleMike Kaganski
... instead of tools::Rectangle. Several problems were there: 1. First, a horizontal bounding rectangle was calculated, with due rounding; and then the result was rotated, and after that, rounded again. That made the resulting rotated rectangle coordinates very imprecise. 2. Also, ceil/floor was applied without normalization; and in case of rotated font, that meant, that sometimes the range could be not expanded to cover partially covered pixels, but instead collapsed. 3. The rotation to angles other than 90 degree multiples was done incorrectly, resulting in cut off parts of characters. 4. For 90 degrees, the imprecise result of sin/cos converted 0.0 into values like 3e-16, which then could be ceil'ed up to 1. Using B2DRectangle and its transform allows to simplify and fix the calculations easily, and avoids premature rounding. Render of rotated text of small size is more stable with this change. Change-Id: Idffd74b9937feb2418ab76a8d325fdaf4ff841b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165553 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-01vcl: get rid of NO_PENDING defineTomaž Vajngerl
Change-Id: I90c3a29da63222bba2d497a27d7deec0865a6104 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165211 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-04-01vcl: remove partial XPM image loadingTomaž Vajngerl
This removes the code that handles the IO_PENDING and the graphic "context" handling from XPM image format. Partial loading of images complicates the image filter life cycle a lot (many exceptions) and is not really needed so much today as this was needed in the past. In most cases we load the whole image in one pass anyway. Even loading from the network should be fast enough to not cause issues for the user. Most image filters don't even implement this like PNG and nobody noticed for many years that this is not supported. To handle IO_PENDING case it is probably better to load the bitstream into memory and then load the whole image after that in one pass. This can also be implemented all inside (Imp)Graphic in a very straight forward way. Change-Id: Icdc4f042b38936e3d9f11d7026fd8525a6f46943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165210 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-31Resolves: tdf#157587 IconView scoll range not updatedCaolán McNamara
IconView::SetUpdateMode(true) doesn't update the scroll range for any changes that might have taken place while updates were suspended. The similar SvImpLBox::UpdateAll() for "normal" lists does this update, so do the equivalent update here too. Noticeable since: commit 666925f2ab06e690c41c470713dc83f2d752bfb7 Date: Sat Jun 3 15:23:15 2023 +0100 perf: use freeze/thaw around block insert of multiple icons Change-Id: I318fc4509c6906161eabf3b312f311cb97ac063a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165584 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-31tdf#146619 Drop unused 'using namespace' in: vcl/Gabor Kelemen
Change-Id: Id25d5e3dbf84dea1f9aca5a6ec921d30cbe84bf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165524 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-30Simplify and avoid const_castMike Kaganski
Change-Id: I963bccd565750b41f16e3585f9a358678aa28500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165576 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-30This should copy from sourceMike Kaganski
Was this way since initial commit Change-Id: I4159d8969853a9f1e226326bcd5180aedeed50dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165575 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-30vcl: cleanup XPMReader class - rename members with clearer namesTomaž Vajngerl
Change-Id: I185a72a972d35c29d774a53476a345664497be6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165209 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-30vcl: remove partial XBM image loadingTomaž Vajngerl
This removes the code that handles the IO_PENDING and the graphic "context" handling from XBM image format. Partial loading of images complicates the image filter life cycle a lot (many exceptions) and is not really needed so much today as this was needed in the past. In most cases we load the whole image in one pass anyway. Even loading from the network should be fast enough to not cause issues for the user. Most image filters don't even implement this like PNG and nobody noticed for many years that this is not supported. To handle IO_PENDING case it is probably better to load the bitstream into memory and then load the whole image after that in one pass. This can also be implemented all inside (Imp)Graphic in a very straight forward way. Change-Id: Idb11f4ffa821467374b19f22b5841cfe940b9457 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165208 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-30vcl: add resetLastUsed to ImpGraphTomaž Vajngerl
We reset the last used member variable in many places in the same way, so instead of duplicating the implementation, add that to a method. Change-Id: I747559ecf1a6736f976b4d560ab5052c19431898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165207 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-30vcl: cleanup and prefixmembers of XBMReaderTomaž Vajngerl
Change-Id: Ib424c3818a7441f9a1c3a7fb2be2d0a7b9682ee7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165206 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-30vcl: change (graphic) Manager into a general memory managerTomaž Vajngerl
Graphic memory manager was changes so that it can work with any object that implements a specific interface (MemoryManaged). With this it will be possible to use other objects (that take a lot of memory) to be managed by the manager. It is also a first step to move memory managin responsibilities away from Graphic and move it into the specific objects instead (BitmapEx, Animation and VectorGraphic). Change-Id: I7638bd89a1c9ece5c4bc95b506d2192492894ef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164958 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-30Related: tdf#160159 use a stock icon for the character mapCaolán McNamara
https://specifications.freedesktop.org/icon-naming-spec/0.8/ar01s04.html Where "accessories-character-map" is "The icon used for the ... character accessory program" Change-Id: I48c72aaa3827037eb6921571bcce061fe60ac135 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165561 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-29ofz#67699 Integer-overflowCaolán McNamara
Change-Id: Ifb949cb4816c21587f337827fe50f993a64a3f60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165509 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-29convert VCLSession to comphelper::WeakComponentImplHelperNoel Grandin
Change-Id: I74bc44f84dd6dccde602c31a0f87a1780e3e7231 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165495 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-29Simplify a bitMike Kaganski
Change-Id: I2a5b870516d8b597ebf476c7c1da7549a27571ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165503 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-28fix comparison of UIObject's inside UITestsNoel Grandin
using == to compare them doesnt work, because we return a new one with every call to getTopFocusWindow and similar. So add a equals() method to the UNO interface to do the comparison. Change-Id: Ie909fe9b4e84fe07f4ca87bbebf65b56d3da8f78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28tdf#153162 Gif load transparency optimizationAttila Szűcs
Converting a bitmap from transparency to alpha can be very slow. fortunately it can be avoided. Inverted the transparency colors (cTransIndex1, cNonTransIndex1) that are used to create aBmp1 in GIFReader::FillImages. It create the transparency bitmap inverted, so no need to invert it. Change-Id: I14714fe4b8bbcd7849db57b2824a7077dda40f81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165261 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-28vcl: Implement JSLevelBarHubert Figuière
This fixes the JSDialog layout of the sheet protection dialog. This was introduced for 24.02 to provide password strength indication of the sheet password. Defined a new WindowType of PROGRESSBAR. The type property in JSDialog JSON will be "progressbar". Change-Id: I202528a81706943e1838f3c37fb555f4a1bf889e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165236 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-28improve logging in UITestsNoel Grandin
(1) log useful stuff that is happening instead of logging events that are __not__ interesting (2) add the UIObject title to the event so we know who the event belongs to Change-Id: Iea4b70c03482b10731f186d730afa12dac760fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-28prevent SEGV in ToolBoxUIObject::get_stateNoel Grandin
if we call it while it has no current item id Change-Id: I0e62d35b24f18104f6fd55c129fd7f91f2449e5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-27Resolves: tdf#160392 preview's measurement are black on dark bg in dark modeCaolán McNamara
Change-Id: I538750ef7d20ecc17a60ce47989eeaf0390a0103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165405 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-26Set the condition, even when main thread message queue is emptyMike Kaganski
Post an empty user event for that. Change-Id: I9ab4b4374a25eddce8c58d36f58e08bec4a1855c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165352 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-26crash on deref null parent on attempting to find labelCaolán McNamara
ImplFindDlgCtrlWindow always calls ImplGetChildWindow with first arg which does pParent = ImplGetTopParentOfTabHierarchy( pParent ); vcl::Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex ); ImplGetSubChildWindow always derefs its first arg and ImplGetTopParentOfTabHierarchy only returns null if its input was null so ImplFindDlgCtrlWindow shouldn't be called with null program/libmergedlo.so(_ZNK3vcl6Window13ImplGetWindowEv+0x4)[0x7513e2a40e54] program/libmergedlo.so(+0x33ba57c)[0x7513e29ba57c] program/libmergedlo.so(+0x33ba97c)[0x7513e29ba97c] program/libmergedlo.so(+0x33baf64)[0x7513e29baf64] program/libmergedlo.so(+0x3378d47)[0x7513e2978d47] program/libmergedlo.so(_ZNK3vcl6Window30GetAccessibleRelationLabeledByEv+0x19c)[0x7513e297866c] program/libmergedlo.so(_ZN3vcl6Window18DumpAsPropertyTreeERN5tools10JsonWriterE+0x241)[0x7513e2a4b301] program/libmergedlo.so(_ZN6Dialog18DumpAsPropertyTreeERN5tools10JsonWriterE+0x2e)[0x7513e29b217e] program/libmergedlo.so(_ZN3vcl6Window18DumpAsPropertyTreeERN5tools10JsonWriterE+0x182)[0x7513e2a4b242] program/libmergedlo.so(_ZN3vcl3lok9dumpStateERN3rtl13OStringBufferE+0xc0)[0x7513e2d6ee80] Change-Id: I732550bd67c3af38627849a7d96d8ee6140008b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165314 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-25Relax SolarMutexReleaser precondition to not require SolarMutex lockMike Kaganski
As discussed on https://gerrit.libreoffice.org/c/core/+/164843/2#message-8873d3d119de7206b33bc824f5809b8b1d3d97da, it is impossible at times to know in advance, if a specific code, that must not be guarded by SolarMutex (e.g., calling to other threads, which might need to grab the mutex), will itself be guarded by SolarMutex. Before this change, a required pre-requisite for SolarMutexReleaser use was existing lock of SolarMutex; otherwise, an attempt to release it would call abort(). Thus, in some places we had to grab the mutex prior to releasing it, and that itself introduced more potential for deadlock. Now the SolarMutexReleaser is safe to use without the lock, in which case, it will do nothing. Change-Id: I8759c2f6ed448598b3be4d6c5109804b5e7523ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165262 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-24for compilaton with OSL_DEBUG_LEVEL > 1, adapt to the commit f9395a12, which ↵Tomoyuki Kubota
replaced std::vector with KernArray Change-Id: I12e918814a29fff114c5eae320498a8fc0229dea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165233 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-23Harmonization of warning and error colorsHeiko Tietze
* hard-coded colors from infobar moved to settings * weld::LabelType::Warning and ::Error uses these colors * gtk3 native configuration removed Change-Id: Ia80584e9267b8385f7f6b25322f5a85a2570af68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165161 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2024-03-23vcl: set "default" type only thorugh a ImpGraphic constructorTomaž Vajngerl
and do some more clean-up. Change-Id: I28c33887226444046d21076118fd066eb3a231d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164947 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-22vcl: simplify constructors of ImpGraphicTomaž Vajngerl
Change-Id: I6df0da16d777549e6187327271868774498d073b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164694 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-22vcl: remove SetSizePixel from BitmapExTomaž Vajngerl
Makes no sense (and would case serious problems) to set the size (pixel) from the outside of the BitmapEx. Change-Id: Iab597f755d45be2380884ec6685d119fcc8b1e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164946 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-21tdf#93352 Fix horizontal swiping and scrolling when using an RTL UIPatrick Luby
Starting with commit bfa21ce5fa08f2c634ccb6162914be55aef9f3c2, horizontal swiping in Calc moved in the wrong direction scrollbars were drawn mirrored. So, revert parts of commit bfa21ce5fa08f2c634ccb6162914be55aef9f3c2 so that we are using Calc's previous "negative scrollbar range" implementation for RTL UIs, but only for horizontal scrollbars since vertical scrollbars are the same in LTR and RTL UIs. Also, always disable RTL for scrollbars. Enabling RTL causes the following bugs when clicking or dragging the mouse in scrollbars in Calc's RTL UI: - Click or drag events get mirrored so you must click or drag in unexpected locations to move the scrollbar thumb in the desired direction - Repeatedly dragging the scrollbar thumb leftward can only move no highter than the R, S, or T columns Note: even though RTL is always disabled for Calc scrollbars, the arrows must still be swapped in vcl's ScrollBar class. Change-Id: I85aac94ffaf7df2eeb251a3ff150cc0363b5d770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164959 Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org> Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-03-20vcl: move Vectorize out of Bitmap - add Vectorizer classTomaž Vajngerl
Change-Id: I991b6e908d4139723c2d408d4ba3586676fded18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164693 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-19ofz#67495 Out-of-memoryCaolán McNamara
Change-Id: I9c0264b5f474e5448ecaea55e608001438654302 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165016 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-16ofz#67445 TimeoutCaolán McNamara
Change-Id: I968f57c9c71e764ade189deca1534983e33cc401 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164932 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-15tdf#160020: don't hide mnemonics, when auto-accel feature is offMike Kaganski
Change-Id: I08ee0ba87c5c54403a329100b69e96aac3aded28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164857 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-14Make sure we hold the solar mutex before trying to release itMike Kaganski
Might be not guarded by the solar mutex (and need not to!) e.g. when an external script calls XDispatchHelper::executeDispatch, with stack like this: vcllo.dll!vcl::SolarThreadExecutor::execute() Line 55 C++ fwklo.dll!vcl::solarthread::detail::GenericSolarThreadExecutor<`framework::DispatchHelper::executeDispatch'::`8'::<lambda_1>,com::sun::star::uno::Any>::exec(const framework::DispatchHelper::executeDispatch::__l8::<lambda_1> & func) Line 63 C++ fwklo.dll!vcl::solarthread::syncExecute<`framework::DispatchHelper::executeDispatch'::`8'::<lambda_1>>(const framework::DispatchHelper::executeDispatch::__l8::<lambda_1> & func) Line 166 C++ fwklo.dll!framework::DispatchHelper::executeDispatch(const com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> & xDispatchProvider, const rtl::OUString & sURL, const rtl::OUString & sTargetFrameName, long nSearchFlags, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & lArguments) Line 116 C++ mscx_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 214 C++ mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430 C++ binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny * returnValue, std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny>> * outArguments) Line 239 C++ binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79 C++ binaryurplo.dll!request(void * pThreadSpecificData) Line 84 C++ cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool bReturnWhenNoJob) Line 101 C++ cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169 C++ cppu3.dll!threadFunc(void * param) Line 190 C++ sal3.dll!oslWorkerWrapperFunction(void * pData) Line 69 C++ ucrtbased.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) Line 97 C++ kernel32.dll!BaseThreadInitThunk() Unknown ntdll.dll!RtlUserThreadStart() Unknown Change-Id: Ic8ffa802f8d9f9165bf5274ddbc06fd70d3a5f5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164843 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-13Assert in ProcessEventsToIdle, that idles are not delayedMike Kaganski
As noted in https://gerrit.libreoffice.org/c/core/+/164753/9#message-88182774825ae8722961d099d643a6df6f4001a7: > I think this needs an assert inside ProcessEventsToIdle if the guard count > 0. > Otherwise we are going to get very hard to debug lock ups. Change-Id: I2b8753da7a6ae1672ce5d8634771174d87fe376c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164781 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-13Introduce a guard to delay processing of idlesMike Kaganski
In a following scenario, there could be a crash: 1. Platform: a Windows system with MS Word installed. 2. LibreOffice is run in a listener mode; 3. A Java program opens a Writer document in a visible mode, with an embedded Word OLE object; 4. It adds some text; then resizes the OLE object; then removes the OLE object. Word OLE objects have OLEMISC_RECOMPOSEONRESIZE flag [1]; this means, that every re-layout of the document with this object must ask the OLE server to re-layout the object content. So, the request thread changes the document text, which triggers idle re-layout or redraw; the idles start executing immediately in the idle main thread, with solar mutex locked; then the request thread starts the OLE object removal operation. The ongoing relayout in main thread would at some stage need to execute a call to the OLE object, which temporarily releases the solar mutex (this makes impossible using solar mutex to synchronize the order of operations in this scenario). Other mutexes guarding OLE object (in OleEmbeddedObject, and in OleComponent) are also released for the duration of the call. Thus, the removal that happens in the request thread proceeds, and the node containing the OLE object is destroyed, while the main thread (processing exactly this node) is waiting for the OLE server response, then for mutexes, to proceed. After that, the main thread would attempt to access the destroyed node object. This change introduces a scheduler guard (a RAII object), that sets a flag to not process idle events during the lifetime of the guard. In its constructor, it also makes sure, that current pending idle events are finished. This would make sure that guarded code started from other threads would not race with idles potentially accessing the model that is currently in transient state. [1] https://learn.microsoft.com/en-us/windows/win32/api/oleidl/ne-oleidl-olemisc Change-Id: I2ef0601ccd8b5872588a88493d1f43e39022dbed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164753 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-13Process pending events before ImplDeleteOnDeInitMike Kaganski
The statics derived from DeleteOnDeinitBase are destroyed in the call to ImplDeleteOnDeInit; and then they may be accessed, when a few lines later, Scheduler::ImplDeInitScheduler is called, which itself calls ProcessEventsToIdle. This change makes sure that the events, that may potentially want to access these objects, are executed at a safe time. Change-Id: Idc04100453ed12def815b721e3efe76cb3ca1100 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164752 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-13SAL_WARN -> SAL_INFONoel Grandin
Change-Id: I1a958ca6e9a084b2237f6467b17476ffeb5a987a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164725 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-08cid#1592989 Dereference after null checkCaolán McNamara
Change-Id: I34276f9324e994fa1ea174719b60d492b1e595f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164563 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-08use more string_viewNoel Grandin
found by tweaking the stringview loplugin Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-08tdf#159996 use transparent alpha mask for output devicePatrick Luby
Since commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, fixed text needs to be drawn to an output device with a transparent alpha mask. Change-Id: I2036e8c6c9133b1caceb24aeca40f04524c16b23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164556 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-03-07Simplify some rtl::math::approxEqual callsNoel Grandin
Comparing with zero is simple - the implementation special-zases zero. Change-Id: Ia2fe8a1100941f72023a74955ebfbb4f5f25b90d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>