summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2024-11-27Reuse SAL_ACCESSIBILITY_ENABLED to allow disabling a11y on WindowsMike Kaganski
After commit c5b6e3ac564c35aa10744d498b372fa5d4f68bf3 (win a11y: Stop using setting to indicate AT support, 2024-10-30), the a11y status doesn't depend on a setting, and will be enabled whenever anything on Windows sends a WM_GETOBJECT messaage to a window. To allow debugging without a11y interference, use the existing SAL_ACCESSIBILITY_ENABLED environment variable, and extend it to use its "0" value to disable. Change-Id: I43bdec59a195ace3f704206d9ebe07352dd3e819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177385 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-27vcl: Drop unnecessary casts in VclMultiLineEditMichael Weghorn
Neither the const_cast, nor the explicit cast to vcl::Window is needed here in order to call vcl::Window::GetBorder. Change-Id: Id234d21e6d9792e83487fc5503cd737fe3832b91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177377 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-27weld: Rename weld::Dialog::{widget -> button}_for_responseMichael Weghorn
Rename weld::Dialog::widget_for_response to weld::Dialog_button_for_response as it specifically returns a weld::Button, not a generic weld::Widget (other than GTK's `gtk_dialog_get_widget_for_response` [1] which returns a GtkWidget). [1] https://docs.gtk.org/gtk3/method.Dialog.get_widget_for_response.html Change-Id: I3b1dc34c0af752853551d2ebb706109f2214720d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177376 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-27weld: Return unique_ptr in weld::Dialog::widget_for_responseMichael Weghorn
... to make more obvious from the API that the caller owns the returned weld::Button* (but not the underlying toolkit widget). Change-Id: I64f57f80e4eea4c2c984fa7b615b5a2350ed892a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177375 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-27Release CXNotifyingDataObject in separate threadMike Kaganski
The reported deadlocking situation at paste was: 1. Thread CMtaOleClipboard::run() is handling CXNotifyingDataObject::Release, which calls CWinClipboard::onReleaseDataObject before deleting self, and that eventually tries to lock solar mutex: sal3!osl_acquireMutex+0x49 [sal\osl\w32\mutex.cxx @ 65] vclplug_winlo!osl::Mutex::acquire+0xa [include\osl\mutex.hxx @ 63] vclplug_winlo!SalYieldMutex::doAcquire+0x91 [vcl\win\app\salinst.cxx @ 148] vcllo!osl::Guard<comphelper::SolarMutex>::{ctor}+0xe [include\osl\mutex.hxx @ 144] vcllo!SolarMutexGuard::{ctor}+0x1b [include\vcl\svapp.hxx @ 1340] vcllo!TransferableHelper::lostOwnership+0x36 [vcl\source\treelist\transfer.cxx @ 487] vclplug_winlo!CXNotifyingDataObject::lostOwnership+0x61 [vcl\win\dtrans\XNotifyingDataObject.cxx @ 140] vclplug_winlo!CWinClipboard::onReleaseDataObject+0x57 [vcl\win\dtrans\WinClipboard.cxx @ 364] vclplug_winlo!CXNotifyingDataObject::Release+0x36 [vcl\win\dtrans\XNotifyingDataObject.cxx @ 77] combase!Ordinal230+0x1c9b ... combase!Ordinal87+0x3d19 USER32!DispatchMessageW+0x741 USER32!DispatchMessageW+0x201 vclplug_winlo!CMtaOleClipboard::run+0x18f [vcl\win\dtrans\MtaOleClipb.cxx @ 657] 2. Thread CMtaOleClipboard::clipboardChangedNotifierThreadProc() is handling the respective event, calling CWinClipboard::handleClipboardContentChanged, which notifies listeners, including SwClipboardChangeListener, which, in its changedContents, has locked solar mutex, and requests the clipboard content, which eventually calls CMtaOleClipboard::getClipboard posting a message to the CMtaOleClipboard::run() thread, and waiting the result: vclplug_winlo!`anonymous-namespace'::Win32Condition::wait+0x3b [vcl\win\dtrans\MtaOleClipb.cxx @ 92] vclplug_winlo!CMtaOleClipboard::getClipboard+0x220 [vcl\win\dtrans\MtaOleClipb.cxx @ 355] vclplug_winlo!CWinClipboard::getIDataObject+0x84 [vcl\win\dtrans\WinClipboard.cxx @ 161] vclplug_winlo!CDOTransferable::tryToGetIDataObjectIfAbsent+0x56 [vcl\win\dtrans\DOTransferable.cxx @ 413] vclplug_winlo!CDOTransferable::getClipboardData+0x79 [vcl\win\dtrans\DOTransferable.cxx @ 425] vclplug_winlo!CDOTransferable::getTransferData+0x163 [vcl\win\dtrans\DOTransferable.cxx @ 252] sotlo!GetTransferableAction_Impl+0x13d [sot\source\base\formats.cxx @ 1352] sotlo!SotExchange::GetExchangeAction+0xde [sot\source\base\formats.cxx @ 1429] swlo!SwTransferable::IsPaste+0xba [sw\source\uibase\dochdl\swdtflvr.cxx @ 1402] swlo!SwClipboardChangeListener::changedContents+0xac [sw\source\uibase\uiview\uivwimp.cxx @ 315] vclplug_winlo!comphelper::OInterfaceContainerHelper4<com::sun::star::datatransfer::clipboard::XClipboardListener>::NotifySingleListener<com::sun::star::datatransfer::clipboard::ClipboardEvent>::operator()+0xc [include\comphelper\interfacecontainer4.hxx @ 274] vclplug_winlo!comphelper::OInterfaceContainerHelper4<com::sun::star::datatransfer::clipboard::XClipboardListener>::forEach<comphelper::OInterfaceContainerHelper4<com::sun::star::datatransfer::clipboard::XClipboardListener>::NotifySingleListener<com::sun::star::datatransfer::clipboard::ClipboardEvent> >+0xb6 [include\comphelper\interfacecontainer4.hxx @ 304] vclplug_winlo!comphelper::OInterfaceContainerHelper4<com::sun::star::datatransfer::clipboard::XClipboardListener>::notifyEach+0x28 [include\comphelper\interfacecontainer4.hxx @ 325] vclplug_winlo!CWinClipboard::handleClipboardContentChanged+0x156 [vcl\win\dtrans\WinClipboard.cxx @ 303] vclplug_winlo!CWinClipboard::onClipboardContentChanged+0x5c [vcl\win\dtrans\WinClipboard.cxx @ 387] vclplug_winlo!CMtaOleClipboard::clipboardChangedNotifierThreadProc+0x172 [vcl\win\dtrans\MtaOleClipb.cxx @ 699] This change tries to untie this, by creating a dedicated thread to call CWinClipboard::onReleaseDataObject and delete CXNotifyingDataObject outside of its Release (and of the CMtaOleClipboard::run() thread), so that locking happening in that process doesn't deadlock functional threads. Change-Id: I93da6fe79225319a84b332c81716793f4d9fb05d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177363 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-26Fix typoAndrea Gelmini
Change-Id: Ia1395f64bdc649f8e0f450b9173d302efa058c9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177326 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2024-11-26tdf#162815 Greyscale images not corrrectly exported to PDFNoel Grandin
regression from commit 21734247d58a6e915b058d8fa55ece949d049613 "drop internal support for 1-bit images" This only works on Linux because the HasGreyPaletteAny() check is returning false on Linux, because on linux the swap in/out is more aggressive, and after it is has gone through the swap in/out process, the image palette is no longer one that matches anything that HasGreyPaletteAny() checks for (it contains 256 entries, but only 2 of them are used) I'm not exactly sure why the greyscale bitmap generation code is generating bad PDF data, but the RGB code works great, so lets just use that rather. Change-Id: Ibb9e837540d5ed567c706e21e7ff93fe92118580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177329 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-26Libreoffice Theme Part 5: OSX Color CustomizationSahil Gautam
We don't draw popup menus and menubar rather use the native ones. I don't know any Objective-C which made it really difficult for me to parse the widget toolkit code. I can learn it if required, but it would be better if some macos developer takes this patch further; Themeing related objects like colors, persona settings (TODO) will be available via the ThemeColors class. Change-Id: Idd89328ca82fbfa58b1e686b5b105469bea4b4a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171239 Tested-by: Jenkins Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de> Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-11-26Libreoffice Theme Part 4: Windows Color CustomizationSahil Gautam
I couldn't find any way of putting the colors from the theme back into the system using the win32 api. Taking inspiration from Caolan's dark mode patch (commit: a3f400886768bf95fbd8e6b236e11d7aac393b96, related: tdf#118320 enable some windows dark theme support, 2022-03-17), I was able to make it work. I am working on vcl welding for windows, for which I am learning win32. In the coming weeks/months the themeing approach for windows is expected evolve because of that. There are some "rough edges" still... something to be addressed later in different tickets. Change-Id: I4b4cb3804b9b7a9d15e75a1b2511cdedda2b5b12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170840 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de>
2024-11-26pdf: write encrption O and U values as hex stringTomaž Vajngerl
This is easier to evaluate when opening the file in text editor than binary. It is also more common in other PDF writers to use it as hex string. There is no problem with viewers. Change-Id: Ie453556d22695017916c7953f91c499e3d990b0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176891 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins
2024-11-25Resolves: tdf#163777 Ignore pageup and down when modifier held...Caolán McNamara
in a SalInstanceEntryTreeView, otherwise the ctrl+pageup/down gets processed twice by the toplevel notebook due to the forwarding used here. Change-Id: Ic5003064ddba44f940fb4c4a727d8081c3644361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177277 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-11-25Improve rendering speed for native controls when using Skia/MetalPatrick Luby
While debugging tdf#163945, Xcode's Instruments application uncovered the following performance bottlenecks when using Skia/Metal: 1. Very slow rendering an NSBox: Many system colors have the NSColorTypeCatalog color type. For some unkown reason, setting the NSBox's fill color to a color set to NSColorTypeCatalog causes drawing to take at least twice as long as when the fill color is set to NSColorTypeComponentBased. So, only draw with a fill color set to NSColorTypeComponentBased. 2. Excessively large offscreen buffers when drawing native controls: The temporary bitmap was set to the control region expanded by 50 * mScaling (e.g. both width and height were increased by 200 pixels when running on a Retina display). This caused temporary bitmaps to be up to several times larger than needed. Also, drawing NSBox objects to a CGBitmapContext is noticeably slow so filling all that unneeded temporary bitmap area can slow down performance when a large number of NSBox objects like the status bar are redrawn in quick succession. Using getNativeControlRegion() isn't perfect, but it does try to account for the focus ring as well as the minimum width and/or height of the native control so union the two regions set by getNativeControlRegion() and add double the focus ring width on each side just to be safe. In most cases, this should ensure that the temporary bitmap is large enough to draw the entire native control and a focus ring. 3. Unncessary copying of bitmap buffer when drawing native controls: Let Skia own the CGBitmapContext's buffer so that an SkImage can be created without Skia making a copy of the buffer. Change-Id: Ibd3abb4b9d7045c47268319772fe97a5c4dba3c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177225 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
2024-11-25a11y: Avoid const_cast in Window::getLegacyNonLayoutAccessibleRelationLabelForMichael Weghorn
Make the ImplGetLabelFor param const, so the const `this` can just be passed to it as is. Change-Id: Ie6f0c5100cc67050012d9165b436cbd76550d8d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177248 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-25vcl: Use non-const local var instead of const_casting laterMichael Weghorn
Change-Id: I34ddf601a4f48aa894e32ae0842fd30f4cfe823b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177247 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-25a11y: Make ImplGetLabeledBy param const and drop const_castMichael Weghorn
Change-Id: I7b9d61a5a6752985d17633f2a1aff80d86a7011a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177246 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-25a11y: Make param const to avoid const_cast in callerMichael Weghorn
Make the `pWindow` param for `ImplFindDlgCtrlWindow` a const pointer, which removes the need to `const_cast` when calling the function in Window::getLegacyNonLayoutAccessibleRelationMemberOf. Change-Id: I2225f5c4be33060c1e3fddd5e83760e68856585d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177245 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-25pdf: Introduce a IPDFEncryptor and use it in PDFWriterImplTomaž Vajngerl
The idea of IPDFEncryptor is to be the interface to encrypt the stream/string in the same way, irregardless which PDF encryption version/revision we are using. Change-Id: Ie7835384f1be5a44c53985b01c8187323400aa0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176890 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-24tdf#130857 qt weld: Notify about Expander state changeMichael Weghorn
Call weld::Expander::signal_expanded when the QtExpander expanded state changes, e.g. when its button gets clicked. In order to do that, introduce a signal in QtExpander and connect to that in QtInstanceExpander. With this in place, a breakpoint in weld::Expander::signal_expanded now gets hit as expected when (un)expanding the expander in the "Set Password" dialog triggered in Writer using "File" -> "Save As", check "Save with password" checkbox and press "Save" when using the qt6 VCL plugin with SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. This implements what was mentioned as still missing in earlier commit Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sun Nov 24 01:20:31 2024 +0100 tdf#130857 qt weld: Add QtInstanceExpander as > Signal handling still needs to be implemented > (calling `weld::Expander::signal_expanded` when > the expanded state is toggled). Change-Id: I9cd1b2cc99018f84ba930d55399953266119bed0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177199 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-24tdf#130857 qt weld: Support "Save with password" dialogMichael Weghorn
Declare support for the "Set Password" dialog that can be triggered in Writer using "File" -> "Save As", check "Save with password" checkbox and press "Save" to trigger the dialog. This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. This makes use of QtInstanceExpander added in Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sun Nov 24 01:20:31 2024 +0100 tdf#130857 qt weld: Add QtInstanceExpander Currently, I see a small rendering issue when opening that dialog and expanding the expander: The "Enter password to allow editing" and "Confirm password" label text is a bit cropped. It's shown fine when manually enlarging the dialog a bit, however. Change-Id: I37775fa3a39d621696d2a6aaa49bd11d6cfb9350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177198 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-24tdf#130857 qt weld: Add QtInstanceExpanderMichael Weghorn
Add a new QtInstanceExpander class that is the weld::Expander implementation using a native Qt widget. It uses the custom QtExpander widget added in Change-Id: Id2366834cb542eba613ea087e70f3a812d20fa89 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sun Nov 24 00:07:44 2024 +0100 tdf#130857 qt weld: Implement "GtkExpander" equivalent Extend QtExpander to provide what's needed to implement the QtInstanceExpander methods. Let QtInstanceBuilder::weld_expander return an instance of the new class. Signal handling still needs to be implemented (calling `weld::Expander::signal_expanded` when the expanded state is toggled). QtInstanceExpander is e.g. needed by the "Set Password" dialog. ("File" -> "Save As", check "Save with password" checkbox and press "Save" to trigger the dialog.) Change-Id: I7e3a332c0417b1897ae57d7d4c29609245fb5e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177197 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24tdf#130857 qt weld: Support "Safe Mode" dialogMichael Weghorn
Now that "GtkExpander" support has been implemented, declare support for the "Safe Mode" dialog that can be triggered via "Help" -> "Restart in Safe Mode" and confirming with "Restart". This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. Change-Id: I67ef04356a5147c24442cd3ec84e4bbc644b3a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177196 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24tdf#130857 openlockedquerybox.ui: Define grid children in orderMichael Weghorn
Switch the order in which the children of the grid in the .ui file are defined so that the order matches the visual appearance, which makes sure that tab focus order with the Qt-based VCL plugins is correct as well in that dialog when using native Qt widgets after support for that dialog was added in Change-Id: If30736e70172c6b25feee0072c952274754aa81e Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sun Nov 24 00:22:26 2024 +0100 tdf#130857 qt weld: Support "Document in Use" dialog See commit 02692566ad9fc7c3484f8581ffa0004cd4e43987 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Thu Oct 24 17:43:35 2024 +0200 tdf#130857 optnewdictionarydialog.ui: Define focusable widgets in order for more background. Change-Id: Ie18c7b91911fea612167510e9bb098d63e1e9227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177195 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-24tdf#130857 qt weld: Support "Document in Use" dialogMichael Weghorn
Declare support for the dialog shown when trying to open a file that's already opened by another user (or more exactly, for which a lock file suggesting that it's opened by another user or LO instance exists). This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. This is the first supported dialog making use of "GtkNotebook"/ QtInstanceNotebook, i.e. of what was implemented in previous commit Sample steps to see that dialog: * start Writer, save document as /tmp/test.odt * kill LibreOffice * open the lock file ( /tmp/.~lock.test.odt# ) in a text editor and change the user name to a dummy one, save. * start LO with qt6 VCL plugin and try to open the document Change-Id: If30736e70172c6b25feee0072c952274754aa81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177194 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24tdf#130857 qt weld: Implement "GtkExpander" equivalentMichael Weghorn
Implement support for "GtkExpander" objects in .ui files. As Qt doesn't seem to have any equivalent, add a new QtExpander class that subclasses QWidget and has a button that can be used to toggle visibility of the widget that is the GtkExpander's [1] content child. For a visual appearance similar to GtkExpander, set an icon for the button ("go-down" and "go-next" from the icon theme, which are arrows like the ones shown on a GtkExpander, at least with the Breeze icon theme). In QtBuilder, implement handling for "GtkExpander" objects: * Create an instance of the new QtExpander class. * Identify the content child, which can be distinguished from the label child by the fact that the latter has a "label" child type set, see also previous commit Change-Id: I3e308a6642d72b55d0ccc597dac716b236c22d61 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sat Nov 23 20:54:47 2024 +0100 tdf#130857 Pass child type to WidgetBuilder::insertObject * Erase the "visible" property for the content child, as otherwise the content widget would be initially visible even if the expander is set to not be expanded. (QtExpander takes care of this, so ignore the property set in the .ui file.) * For the label child in GtkExpander, simply take over its text to QtExpander's button, then mark the label for deletion, as it's not needed otherwise. Support for the "Document in Use" dialog that has a GtkExpander and thuse makes use of this will be declared in a separate commit. [1] https://docs.gtk.org/gtk3/class.Expander.html Change-Id: Id2366834cb542eba613ea087e70f3a812d20fa89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177193 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-24tdf#130857 weld: Move Window::set_centered_on_parent to DialogMichael Weghorn
weld::Window::set_centered_on_parent only ever gets called for weld::Dialog instances, so move it to the weld::Dialog subclass. For the Qt implementation, no longer trigger an assert because of the method being unimplemented (doing nothing), as QDialog opens centered on its parent toplevel by default. Quoting from the QDialog doc [1]: > Note that QDialog (and any other widget that has type Qt::Dialog) uses > the parent widget slightly differently from other classes in Qt. A > dialog is always a top-level widget, but if it has a parent, its default > location is centered on top of the parent's top-level widget (if it is > not top-level itself). (API for moving a QWidget to a different position like QWidget::move [2] exists, but would only work on X11/XWayland, not Wayland.) [1] https://doc.qt.io/qt-6/qdialog.html#details [2] https://doc.qt.io/qt-6/qwidget.html#pos-prop Change-Id: I14d41f91e5297c6e58cb4edb2ee98f19814d45cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177192 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24tdf#130857 Pass child type to WidgetBuilder::insertObjectMichael Weghorn
In WidgetBuilder::handleChild, pass the child type not only to WidgetBuilder::tweakInsertedChild, but also to WidgetBuilder::handleObject (add a new param for that) and from there down into the virtual WidgetBuilder::insertObject, so it can be evaluated by subclasses when creating new widgets. While it is not used yet, an upcoming commit will make use of it in QtBuilder, in order to distinguish between the two "GtkExpander" children: the label and the actual content child. As described in the "GtkExpander as GtkBuildable" doc [1]: > The GtkExpander implementation of the GtkBuildable interface supports > placing a child in the label position by specifying “label” as the > “type” attribute of a <child> element. A normal content child can be > specified without specifying a <child> type attribute. [1] https://docs.gtk.org/gtk3/class.Expander.html Change-Id: I3e308a6642d72b55d0ccc597dac716b236c22d61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177191 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-24tdf#157312 and tdf#163945 Lower Skia flush timer priority on macOSPatrick Luby
On macOS, flushing with Skia/Metal is noticeably slower than with Skia/Raster. So lower the flush timer priority to TaskPriority::POST_PAINT so that the flush timer runs less frequently but each pass copies a more up-to-date offscreen surface. Unfortunately, lowering the priority causes tdf#163734 to reoccur. When a dockable window is dragged by its titlebar, a rectangle may be drawn in its parent window. However, the Skia flush timer doesn't run until after the mouse button has been released (probably due to lowering of the Skia flush timer's priority to fix tdf#163734). So run the parent frame's Skia flush timer immediately to display the rectangle. Change-Id: I289eab85a087cb76a751dc6b777342b8dee49e1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177190 Reviewed-by: Patrick Luby <guibomacdev@gmail.com> Tested-by: Jenkins
2024-11-24Let ESelection use EPaM for simplificationMike Kaganski
And drop EPosition, which duplicates EPaM, except for its default ctor (used in a single place). Change-Id: I48bb6dafcba84465d61579df0ec71b815945532a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177075 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-11-23tdf#130857 qt weld: Hide widget marked for deletionMichael Weghorn
Add a helper method QtBuilder::deleteObject that takes care of marking no longer needed objects for deletion and use it in the 3 places so far calling QObject::deleteLater themselves. If the object marked for deletion is a widget, hide it as well, as it could otherwise still be "in the way". This was seen wit the edit (QLineEdit) of the editable combobox in the "File" -> "Properties" dialog, "General" tab (in a WIP branch for adding support for that dialog), where the unnecessary edit was shown on top of the combobox, hiding the combobox content + dropdown button. Change-Id: Ie299b80824c94d40cfac9f7962c9bd4ba95b446d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177057 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-23tdf#130857 qt weld: Call checkbox toggled handlerMichael Weghorn
Change-Id: I0943a2d8e35acea8e1af97bdd151bba65b0af24a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177056 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-23tdf#130857 qt weld: Handle invalid ID in QtInstanceNotebook::get_pageMichael Weghorn
If QtInstanceNotebook::get_page gets called with and ID that none of the existing pages actually have, return nullptr early and don't try to QtInstanceContainer instance for the null widget, which would trigger an assert when nullptr is passed to the QtInstanceWidget base class ctor. Calling QtInstanceNotebook::get_page with an ID for which no page exists yet is what SfxTabDialogController::AddTabPage does explicitly before asserting a page to assert that there isn't such a page yet. SalInstanceNotebook::get_page and GtkInstanceNotebook also have specific handling for that case. Change-Id: Ib2044fd4c9f986f2252afed5754a6383f940e5e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177055 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-23tdf#130857 qt weld: Implement QtInstanceDialog::weld_content_areaMichael Weghorn
When this method gets called the first time, insert a widget with a QVBoxLayout at the beginning of the dialog's layout, remember and return that. On subsequent call, return the same one. Initially, handle the case where the dialog's layout is a QBoxLayout (subclass), which is the case for the "File" -> "Printer Settings" -> "Options" dialog in Writer. This should be easy to extend for other layouts as well when needed. For now, assert when another layout is used, so it will become clear when working on adding support for another dialog that needs this. Change-Id: Ia41a87f8cf62666efc91c05f25dae5fccb3da41d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177054 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-22loplugin:unusedmethodsNoel Grandin
Change-Id: I24666a7746f8920ddf84731f204f3e1a5b9b0c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177024 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-22pdf: move stream/string encryption into PDFEncryptorTomaž Vajngerl
Change-Id: Ie710e51faa7d65686d72a03d1ef4ca40dff8c27e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176889 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-22pdf: add initial test for PDF 2.0 (check using PDFium)Tomaž Vajngerl
Change-Id: I43e6048d34ee9c51e0602cd671a73b19145a9c17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176888 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-22pdf: wrap more encryption specific code into PDFEncryptorTomaž Vajngerl
To make the code contained, so it is easier to add the new encryption method later. Change-Id: Ie3e3194c2148f6c3cb8ac58709fcd5f74e84a93a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176886 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-11-22notebookbar: Simplify logic to detect whether hidden childrenMichael Weghorn
The actual number of hidden children is not of interest here, only whether there is at least one, so stop iterating once the first hidden child is encountered. Change-Id: Ice1a7461d2bfd9d576109771cf93deb6a17ef975 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176930 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-22notebookbar: Drop PriorityHBox::GetHiddenCountMichael Weghorn
The method is only used in the PriorityMergedHBox subclass, which overrides the method anyway, so drop the base class implementation. Change-Id: If2c11377b1ca0ac0f3c6cd4fec9890cdcbbce0ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176929 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-22notebookbar: Pass menu button as parent for its menuMichael Weghorn
Use the Notebookbar menu button as parent for its menu. This also makes the button position be used as the reference. This allows to drop the now unused NotebookbarTabControlBase::GetHeaderHeight. Also, set the reference point to be at the bottom of the button, so the menu opens below it instead of approximately in the middle, which matches how other menu buttons behave. To test: Set "Tabbed" for the UI variant in "View" -> "User Interface", then click the "Hamburger menu" button in the notebookbar. Change-Id: I0717fad73ff7a42d2bdaaa53a73d055234003d3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176927 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-22vcl: Simplify NotebookbarTabControlBase::ImplActivateTabPage a bitMichael Weghorn
Only set new value for nCurPos if there's a valid new page instead of always doing it and then reverting back to the old value. Change-Id: I25f56e34da6260ee7c586fa25a88ff813f7c26f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176926 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-22vcl: Don't use out param in addition to return valueMichael Weghorn
Let lcl_isValidPage simply return whether the tab item is "valid" and don't set the out param in addition, but let the callers do that, which is more straightforward. Change-Id: I35000d46899f457087c417e91ee1968aab7bd239 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176925 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-21tdf#163486: PVS: variable was assigned the same valueXisco Fauli
Since commit 1a1e953ee33c213dc8b88dd96a69ca9fc5e42d50 Author: Gökçen Eraslan <gokcen.eraslan@gmail.com> Date: Mon Jul 9 13:53:38 2012 +0300 We use hidden signatures for now. V1048 The 'sigHidden' variable was assigned the same value. Change-Id: If394032db0cc848864a640e45a0492eee28b5205 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176917 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-21tdf#163486: PVS: Expression is always trueXisco Fauli
Since commit 47a173edb603538521a035157efb6ef684238087 Author: Noel Grandin <noelgrandin@gmail.com> Date: Sat Sep 15 18:36:08 2018 +0200 use std::vector in PDFWriterImpl for encryption buffer V547 Expression 'buffOK' is always true. Change-Id: I66b0f4de18cfca398da0b4091d980b259f5e9dfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176916 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-11-21use default implementation for drawEPSNoel Grandin
so only the one that implements it needs to override it Change-Id: I19e79c5746dbbebbf5914922587016fd03a902d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-21remove OutDevSupportType::TransparentRectNoel Grandin
all our backends support transparency, and have some time, XRender support became mandatory a couple of years ago. Change-Id: Ie2db7e4665068fe88a926e9791d74a82c2e75834 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176852 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-20Fix typoAndrea Gelmini
Change-Id: I8c8e5c3e6c4e0a8a7f41943ac8c014e1175e093a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176871 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-20Fix typoAndrea Gelmini
Change-Id: I4520061338adfcb13d2eece2f59fb8331c7dbf8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176874 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-20Fix typoAndrea Gelmini
Change-Id: If765fa2c6e7df36dd5d62b351898b61ac263a6e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176872 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-11-20gtk3 a11y: Use OString literalsMichael Weghorn
Change-Id: I23365943e79847e3c7162808de3dc176f7db2b0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176804 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-20tdf#163428 CairoSDPR: Fix regression in freeing unified buffersArmin Le Grand (Collabora)
I had added BufferedData_ModifiedBitmapEx for CairoSDPR (but not only) to allow Bitmaps modualted by BColorModifierStack to be buffered in the standard way and at the original Bitmap. This nicely can still hold the system-dependent form of the Bitmap to be used at the Bitmap of that buffered modified Bitmap. This uses something I was not aware of: One Buffer implementation may - as in this case - use another buffer. That may lead to the second buffer being deleted/freed when the first one gets freed - by timer or directly - what is wanted. This *needs* the methods inside SystemDependentDataBuffer to do the actual potential destruction of the Object outside the Mutex-Locked parts of the code, else this might lead to a deadlock. It is good to have found this, there may be other such combinations in the future: That the implementation of a buffer using that standard mechanism uses another class that may also be buffered. I have now made sure that buffered objects get deleted *outside* the Mutex-Locked areas. This is better anyways, the destruction does not need that lock - it is just needed so secure the manipulation of the local unordered_map that organizes the buffered elements globally. Change-Id: Ie2f346a3f1a24105b89310ace3ff7a41472143c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176795 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Reviewed-by: Moritz Duge <moritz.duge@allotropia.de>