summaryrefslogtreecommitdiff
path: root/vcl/unx
AgeCommit message (Collapse)Author
44 hourstdf#158237: Use C++20 contains() instead of find() and end()Johann
Change-Id: I0528229042aa62d3d99e8dbaad68a86d41cf369a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178659 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
3 daystdf#164393 nicely format gtk-css-declarations for custom themeingSahil Gautam
these are css definitions as strings. previously clang-format messed up the structure and it became quite hard to read the code. now it's excluded from clang-format's range thanks to the // clang-format off/on comments Change-Id: I3ba54a5ac5ef036f08558c607df911a1eb0db1e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179403 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
7 daystdf#152299 - Remove unused define(s) from C/C++ filesBogdan Buzea
Change-Id: I34fcfda19bc9ff35b49faf8892ab14c0f9808943 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177184 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesktop@treblig.org>
11 daystdf#163620 [API CHANGE] Add UI for libreoffice themesSahil Gautam
Instead of Color, we have Light and Dark in the registry. So each theme extension will specify dark and light color values for each "customizable element" like DocColor etc. Under appearance we have three radio buttons - light/dark/system. If system is selected then light/dark colors are switched based on the system's theme. if explicitly light/dark is selected - that color is used from the registry. ColorConfigValue now has three entries nColor, nLightColor, nDarkColor. nColor is used as a cache for the color being used at the moment. This is to avoid otherwise expensive function calls + hundreds of modifications in the codebase just to change nColor. nColor is cached either when the theme is loaded or when changes are committed in `ColorConfig_Impl::ImplCommit()`. Now, if Automatic theme is selected then themes is disabled and the application uses the system colors. If some other scheme is selected like "CustomTheme" etc, then LibreOffice themes/UI color customization is enabled and the theme colors are used. Instead of a scroll window, now we have a combobox for the registry entries and a single color dropdown to select the color value. This color dropdown is for convinience in case the user wants to change some specific color that's bothering him. For themeing, theme extensions should be used. API CHANGE + remove Color in favour of Light and Dark + AppBackground has additional two - BackgroundType and Bitmap + remove officecfg::Office::Common::Misc::Appearnce in favor of officecfg::Office::Common::Appearance::ApplicationAppearance + move LibreofficeTheme under officecfg::Office::Common::Appearance UI + it looks like https://i.imgur.com/UMxjfuC.png which is a little different from how the [mockup] on the ticket describes it, and that's because of lack of time due to upcomming feature freeze. + system/light/dark allow the user to switch between light/dark modes based on either the system theme (system) or by manually specifying light/dark. + ui themeing and color customization is disabled when automatic theme is selected, and enabled otherwise. [mockup]: https://bug-attachments.documentfoundation.org/attachment.cgi?id=197469 Change-Id: I1a7f70dfe44b81f863814f87e8d46e146c0e3d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174835 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de>
11 daystdf#163620 [API CHANGE] remove persona/appearance-toggle related codeSahil Gautam
- remove ui and source files related to app colors and personalization tabs - remove persona entries from registry - remove functions related to persona settings from StyleSettings, vcl.. - remove ui and code related to tools - options - view - appearance combo box Change-Id: I98f0c38dc1facddd0e8dd03197c61a92287fdbc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176836 Tested-by: Jenkins Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de>
12 daysweld: Drop now unused weld::Widget::{g,s}et_grid_*Michael Weghorn
These methods were superseded by corresponding methods in the weld::Grid class in Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Mon Dec 16 11:02:00 2024 +0100 weld: Add weld::Grid to handle grid child positions Now that all existing code has been ported to the new API, drop the unused old methods. Change-Id: I94ffa6a9de5e052e8248276b60f6fe4f10dff697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178638 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
12 daysweld: Add weld::Grid to handle grid child positionsMichael Weghorn
Currently, weld::Widget provides methods that can be used to retrieve and change the position (and column span) of widgets that are located inside of a grid (parent), e.g. weld::Widget::set_grid_left_attach to set the column. These methods however only make sense for widgets that are actually direct children of a grid, not for any "random" weld::Widget. Generally, it's the grid's responsibility to manage child positions, and the gtk3/gtk4 implementations actually assume that the parent is a GtkGrid, retrieve that parent and then call the corresponding GTK API functions for that grid. Align the weld API more with the concept of the grid being responsible for positioning its children by introducing a new weld::Grid class with methods equivalent to the current weld::Widget ones, but that take the child widget as an additional parameter. Take over the existing logic from the corresponding weld::Widget methods for both, the gtk and vcl implementations (e.g. GtkInstanceWidget::set_grid_left_attach -> GtkInstanceGrid::set_child_left_attach). Add an assert that the passed widget is actually a grid child. Deprecate the existing weld::Widget methods for grid position handling. They will be removed once existing code has been ported to the new weld::Grid API. The fact that the vcl implementation, VclGrid (used by vcl's new SalInstanceGrid implementation of weld::Grid), still relies on its vcl::Window children having the corresponding members set correctly remains unaffected. Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178570 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-07weld: Rename weld::Treeview selection signal/connectMichael Weghorn
Rename weld::TreeView member + methods to clarify that these are about selection changes: * m_aChangeHdl to m_aSelectionChangedHdl, * signal_changed to signal_selection_changed * connect_changed to connect_selection_changed In GtkInstanceTreeview, also rename the related methods calling signal_selection_changed accordingly for consistency. Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05vcl: Return reference in SalFrame::GetSystemDataMichael Weghorn
... instead of a pointer, to make clear that this is always non-null. Change-Id: I4c8676913b2507f077d8a66973ab5f95e73cb497 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177886 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05vcl: Return reference in SalObject::GetSystemDataMichael Weghorn
... instead of a pointer, to make clear that this is always non-null. Change-Id: Ic0f92e672b08494cf3bfaa9a956cb78170bc1ad5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177885 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-05gtk4: GtkIconView doesn't have convert_widget_to_bin_window_coordsCaolán McNamara
but still has the same problem as the gtk3 iconview with reporting positions when scrolled a problem since: commit a36a58933a1e07d3f54bacd5c2fe8ca53063a63a CommitDate: Wed Dec 4 07:40:30 2024 +0100 sd: convert sidebar masterpage panels from drawingview to iconview Change-Id: Ice549b40d88c5d2063e37ccb63490e3537736d39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177855 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-12-05weld: Add weld::Widget::signal_* methods to call handlersMichael Weghorn
Similar to what already exists in most subclasses, add signal_<event_name> methods to call the handlers and use these in the subclasses instead of calling the handlers directly. Change-Id: I6b79ddd859b360e947d97ada57f1573a276d6177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177834 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-04gtk4: Unbreak --enable-gtk4 buildMichael Weghorn
gtk_icon_view_convert_widget_to_bin_window_coords was dropped in gtk commit [1] commit 8dc5e13e8c66cd260edff17dbaa10eedcc95ae1b Author: Timm Bäder <mail@baedert.org> Date: Tue Jun 27 11:11:57 2017 +0200 iconview: Remove bin_window , so make the code using it conditional for gtk3. This at least unbreaks the build for now after commit a36a58933a1e07d3f54bacd5c2fe8ca53063a63a Date: Mon Nov 25 17:07:59 2024 +0530 sd: convert sidebar masterpage panels from drawingview to iconview It's possible gtk4 needs to do something else instead, but that can still be added later. See discussion newly started at [2] which might give some insights. [1] https://gitlab.gnome.org/GNOME/gtk/-/commit/8dc5e13e8c66cd260edff17dbaa10eedcc95ae1b [2] https://gerrit.libreoffice.org/c/core/+/177642/comment/4edf0ddd_f71cb30b/ Change-Id: I3bd42614addd03d483c7b41daa2b3a4677b9318e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177769 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-12-04sd: convert sidebar masterpage panels from drawingview to iconviewRashesh
- also removes unused PreviewValueSet Change-Id: I5e7dacb4f472de526a61366295bc91edca12e9ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177642 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-12-02vcl: Add a default SalMenu::GetSystemMenuData implementationMichael Weghorn
Have a default SalMenu::GetSystemMenuData implementation that does nothing instead of being purely virtual and all subclasses except WinSalMenu::GetSystemMenuData having to override it to do nothing. Change-Id: Ia47af286f0fd3c1e3c6a00fff4512c9334fd6e9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177660 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-12-02loplugin:unnecessaryvirtualNoel Grandin
Change-Id: Ie010deb5cdf9da20f2ca60d79feabf1c0de93c57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-29LibreOffice Theme Part 2: GTK Color CustomizationSahil Gautam
Most of the UI is covered by themes. The icon theme changes automatically to light or dark based on the window color. Further improvements will be based on the feedback from the users. Change-Id: Ia63ee608fe7870bc7cc86abb892f5fd5d6f1d8ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168829 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Sahil Gautam <sahil.gautam.extern@allotropia.de> Tested-by: Jenkins
2024-11-28PVS: V612 An unconditional 'break' within a loop.Xisco Fauli
Change-Id: I512969e1583f780b54c035f6a3c3c3e14e783016 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177472 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> 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-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-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-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-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-20gtk: Switch param from const char* to const OString&Michael Weghorn
Change-Id: Ie92591770a2828a5f828d76d8c1bf7e5a253c3de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176814 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-20gtk: Let GetCommandForItem return OString instead of char*Michael Weghorn
This simplifies memory management, as it removes the need to manually free the memory using `g_free` again. Change-Id: I71f8e6a8df46c0090f2f003d3f443500028b1f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176813 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-20tdf#155449 gtk3 a11y: Hold reference to the original AtkObjectMichael Weghorn
Let the AtkObjectWrapper hold a reference to the original AtkObject, and release it in `atk_object_wrapper_finalize`. Without this, the original AtkObject might get destroyed too early. Then trying to access it would result in a crash. While occasionally also seen elsewhere, this was somewhat more reliably reproducible when starting the Orca screen reader or a pyatspi event listener script while the spell check dialog in Writer was shown. Backtrace of how the AtkObject got destroyed (reverse-debugged with rr with a data breakpoint on the AtkObject's accessible description): 1 _int_free_create_chunk malloc.c 4738 0x7fe5766a858e 2 _int_free_merge_chunk malloc.c 4700 0x7fe5766a99b8 3 _int_free malloc.c 4646 0x7fe5766a9d31 4 __GI___libc_free malloc.c 3398 0x7fe5766ac4ff 5 atk_object_finalize atkobject.c 1399 0x7fe5626a7785 6 g_object_unref 0x7fe56e9b94ee 7 expiry_func accessible-leasing.c 122 0x7fe5624f32b1 8 ?? 0x7fe568f0f88e 9 ?? 0x7fe568f0c7df 10 ?? 0x7fe568f0ea17 11 g_main_context_iteration 0x7fe568f0f180 12 GtkSalData::Yield gtkdata.cxx 405 0x7fe5634766ec 13 GtkInstance::DoYield gtkinst.cxx 425 0x7fe56347b493 14 ImplYield svapp.cxx 385 0x7fe56db0e106 15 Application::Yield svapp.cxx 473 0x7fe56db0da9f 16 Application::Execute svapp.cxx 360 0x7fe56db0d880 17 desktop::Desktop::Main app.cxx 1679 0x7fe576926d8b 18 ImplSVMain svmain.cxx 228 0x7fe56db2e996 19 SVMain svmain.cxx 246 0x7fe56db30589 20 soffice_main sofficemain.cxx 121 0x7fe5769a08da 21 sal_main main.c 51 0x5644db935a6d 22 main main.c 49 0x5644db935a47 Backtrace of the crash when using the already deleted object later: 1 g_type_check_instance_cast 0x7fe56e9d9337 2 atk_object_get_index_in_parent atkobject.c 1007 0x7fe5626a5ae5 3 wrapper_get_index_in_parent atkwrapper.cxx 545 0x7fe56344a244 4 atk_object_get_index_in_parent atkobject.c 1011 0x7fe5626a5b3c 5 append_cache_item cache-adaptor.c 183 0x7fe562500591 6 append_accessible_hf cache-adaptor.c 246 0x7fe56250029b 7 g_hash_table_foreach 0x7fe568efacd3 8 spi_cache_foreach accessible-cache.c 423 0x7fe5624f33f9 9 impl_GetItems cache-adaptor.c 328 0x7fe562500174 10 handle_other droute.c 558 0x7fe56250f8a4 11 handle_message droute.c 605 0x7fe56250e7d6 12 ?? 0x7fe5764f5e64 13 dbus_connection_dispatch 0x7fe5764e58ab 14 message_queue_dispatch atspi-gmain.c 89 0x7fe5623abc52 15 ?? 0x7fe568f0c7df 16 ?? 0x7fe568f0ea17 17 g_main_context_iteration 0x7fe568f0f180 18 GtkSalData::Yield gtkdata.cxx 405 0x7fe5634766ec 19 GtkInstance::DoYield gtkinst.cxx 425 0x7fe56347b493 20 ImplYield svapp.cxx 385 0x7fe56db0e106 21 Application::Yield svapp.cxx 473 0x7fe56db0da9f 22 Application::Execute svapp.cxx 360 0x7fe56db0d880 23 desktop::Desktop::Main app.cxx 1679 0x7fe576926d8b 24 ImplSVMain svmain.cxx 228 0x7fe56db2e996 25 SVMain svmain.cxx 246 0x7fe56db30589 26 soffice_main sofficemain.cxx 121 0x7fe5769a08da 27 sal_main main.c 51 0x5644db935a6d 28 main main.c 49 0x5644db935a47 The deleted object is the `AtkObject *accessible` param passed to `atk_object_get_index_in_parent`. This is with at-spi2-core git main as of commit 422cac4bd657ce783164324e6ae4b3d54a8aa761. Change-Id: I23d8a3d55bd587aa99316d71524a18afcd6c0479 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176787 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-20gtk3 a11y: Simplify gtk3/gtk4 version checkMichael Weghorn
One gtk3-specific section is sufficient. Change-Id: I42a5cd1b94df7874665743a386af8e2e19590b0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176786 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-20use default implementation for hasFastDrawTransformedBitmapNoel Grandin
so only the one that implements it needs to override it Change-Id: I1acffb4796d95d75edc4507f533d9b1f8987972b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176790 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-19Simplify SalGraphicsImpl::InitNoel Grandin
it is only used for one thing, so rename it, and use a default implementation to avoid having empty implementations everywhere Change-Id: Ib650bb520ccbfcc27537b754db4d3de4ad10e638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-19loplugin:passparamsbyrefStephan Bergmann
Change-Id: I9ad592670399f25eeaea375bf71e6d30ee20118f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176763 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-11-18simplify X11SalGraphics::DeInitNoel Grandin
it is always called in the destructor, so lets just centralise the logic here Change-Id: I8c9b204d147315b6693fa7a08f759b53b9a6a17c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176731 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-18SalGraphics does not need virtual freeResources()Noel Grandin
it is only called to do one thing, in X11SalGraphics, so make it private to that class, and rename it to better fit its purpose. Change-Id: I16ea2f86f8b596351354faa80bb2bab4d2ac6e7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-18tdf#163792 gtk3: Don't always focus combobox when its popup closesMichael Weghorn
Since commit 405cf00e4818886b0d3053d03cfb2e3f3a5e8eb8 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue May 28 11:50:12 2024 +0200 related tdf#160971 gtk3 a11y: Keep new combobox value , closing an (editable) combobox like the font size one in the Writer formatting toolbar resulted in the combobox's entry having focus, while the focus was set to the document before that commit. Make this work as expected (again), by making grabbing the focus conditional in 2 places: 1) In GtkInstanceComboBox::signal_popup_toggled, only set the focus to the GtkEntry of the custom combobox implementation if the child focus is already inside of the combobox. As I understand it, the intended logic is "move focus from the combo box's button to its entry", not "unconditionally grab the focus". This also matches what the gtk4 implementation does. Sync the comment from the gtk4 implementation, which explicitly mentions the case of the font combobox in the toolbar (which behaves the same as the font size one in that regard) where focus should not be grabbed. 2) In GtkComboBox::menu_toggled, only explicitly set focus to the toggle button if the combo box is located inside of a popup. This is the same condition used to grab all keyboard events. The code to do both was introduced in commit 131c1c7da8c567636ca55751e49d24cb6d6c9b9e Date: Sun Nov 21 19:53:47 2021 +0000 Related: tdf#145786 cooperate between our own grabs whose commit message only explicitly mentions grabs for popups. The scenarios described in the commit message still work as expected with GDK_BACKEND=x11. With this in place, focus now moves to the document as expected when clicking on a combobox entry in the popup for the font size combobox in Writer's formatting toolbar, while clicking an entry in any of the comboboxes in e.g. Writer's "Format" -> "Character" dialog's "Font" tab still results in the entry of the combobox getting focus. Change-Id: Ib07b034f8327dab19a2264ae3ed8e20ea918dd89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176713 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-13loplugin:reftotemp in vclNoel Grandin
Change-Id: Ia5b0fd303f5a3b2c4c119f431517cc063070f4a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-11-12clang-tidy: performance-unnecessary-copy-initialization in vclNoel Grandin
Change-Id: Idb09d0d256601fb3b9e822404b2f57f41d04d713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176443 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-11vcl: Return unique_ptr in weld::Dialog::weld_content_areaMichael Weghorn
This is effectively the weld::Dialog equivalent of Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sun Nov 10 23:01:07 2024 +0100 vcl: Return unique_ptr in weld::MessageDialog::weld_message_area Change-Id: I3eee2d3617c3576b442a5578090cd5de53e17f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176365 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-11vcl: Return unique_ptr in weld::MessageDialog::weld_message_areaMichael Weghorn
The returned weld::Container* (but not the associated toolkit widget) is owned by the caller. Make that more obvious by returning a unique_ptr<weld::Container> instead of a raw pointer. This is also consistent with what other methods returning instances for which the caller takes over ownership (like weld::Widget::weld_parent) do, whereas e.g. weld::Notebook::get_page returns a weld::Container* that is owned by the weld::Notebook instance, not the caller. Change-Id: Ia839fac90ea93b9ac6be5819aa4bb3261a775f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176363 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-10com::sun::star -> cssMike Kaganski
Change-Id: I890ec73e30d3cc6b210903ecee29431f3cb5f635 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175979 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-08no need to take a copy of the getProcessComponentContext return valueNoel Grandin
we can just take a "const &". (found by running clang-tidy with the performance-unnecessary-copy-initialization warning) Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-08tdf#130857 vcl: Move weld::Window::{g,s}et_modal to weld::DialogMichael Weghorn
All calls to get_modal and set_modal are done for weld::Dialog instances, never for plain instances of/pointers to the weld::Window base class. Therefore, drop the methods from weld::Window and add them weld::Dialog instead. SalInstanceDialog was already overriding the SalInstanceWindow implementations of both methods. For QtInstanceWindow, these were not implemented yet, while QtInstanceDialog already has implementations. (If there were a real need, they could be implemented using QWidget::isModal/QWidget::windowModality and QWidget::setWindowModality.) For GTK, move the GtkInstanceWindow::get_modal implementation to GtkInstanceDialog and call gtk_window_set_modal directly instead of GtkInstanceWindow::set_modal in GtkInstanceDialog::set_modal. Change-Id: I71431347f3bca9571c6fd4b7cf995bb79fb5b11d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176252 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-08Simplify a bitMike Kaganski
Change-Id: I618b0f8bcb2e8032ee12367c73e1136685f66b3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176183 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-11-07[API CHANGE] a11y: Switch AccessibleRelationType to enumMichael Weghorn
Switch css::accessibility::AccessibleRelationType from integer constants to an enum. This provides more type safety and improves the debugging experience, e.g. GDB now prints com::sun::star::accessibility::AccessibleRelationType::AccessibleRelationType_CONTENT_FLOWS_TO instead of just "2" when printing the value of a corresponding variable, so it's no longer necessary to manually look up what constant has that integer value to know what relation this refers to. offapi/com/sun/star/accessibility/AccessibleRelationType.idl had this comment: > <p>We are using constants instead of a more typesafe enum. The reason > for this is that IDL enums may not be extended. Therefore, in order to > include future extensions to the set of roles we have to use constants > here.</p> However, the a11y UNO API is internal (not published), so that shouldn't be a concern. Change-Id: I44a7d56cb085dc24effb24fcd34bb222b78ef4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176153 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-11-06cid#1556442 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1607753 COPY_INSTEAD_OF_MOVE cid#1554790 COPY_INSTEAD_OF_MOVE cid#1556463 COPY_INSTEAD_OF_MOVE cid#1554838 COPY_INSTEAD_OF_MOVE cid#1556231 COPY_INSTEAD_OF_MOVE cid#1556878 COPY_INSTEAD_OF_MOVE cid#1554913 COPY_INSTEAD_OF_MOVE cid#1558064 COPY_INSTEAD_OF_MOVE cid#1557043 COPY_INSTEAD_OF_MOVE cid#1556985 COPY_INSTEAD_OF_MOVE cid#1556766 COPY_INSTEAD_OF_MOVE cid#1557351 COPY_INSTEAD_OF_MOVE cid#1554863 COPY_INSTEAD_OF_MOVE cid#1556764 COPY_INSTEAD_OF_MOVE cid#1556279 COPY_INSTEAD_OF_MOVE cid#1555970 COPY_INSTEAD_OF_MOVE cid#1556942 COPY_INSTEAD_OF_MOVE cid#1557964 COPY_INSTEAD_OF_MOVE cid#1555166 COPY_INSTEAD_OF_MOVE cid#1556496 COPY_INSTEAD_OF_MOVE cid#1557175 COPY_INSTEAD_OF_MOVE cid#1558054 COPY_INSTEAD_OF_MOVE cid#1557392 COPY_INSTEAD_OF_MOVE cid#1557850 COPY_INSTEAD_OF_MOVE cid#1555118 COPY_INSTEAD_OF_MOVE cid#1557131 COPY_INSTEAD_OF_MOVE cid#1556614 COPY_INSTEAD_OF_MOVE cid#1609650 COPY_INSTEAD_OF_MOVE cid#1555114 COPY_INSTEAD_OF_MOVE cid#1555241 COPY_INSTEAD_OF_MOVE cid#1555442 COPY_INSTEAD_OF_MOVE cid#1556473 COPY_INSTEAD_OF_MOVE cid#1557654 COPY_INSTEAD_OF_MOVE cid#1554689 COPY_INSTEAD_OF_MOVE cid#1556316 COPY_INSTEAD_OF_MOVE cid#1557929 COPY_INSTEAD_OF_MOVE cid#1554807 COPY_INSTEAD_OF_MOVE cid#1554858 COPY_INSTEAD_OF_MOVE cid#1555103 COPY_INSTEAD_OF_MOVE cid#1555517 COPY_INSTEAD_OF_MOVE cid#1556424 COPY_INSTEAD_OF_MOVE cid#1557252 COPY_INSTEAD_OF_MOVE cid#1557566 COPY_INSTEAD_OF_MOVE cid#1608020 COPY_INSTEAD_OF_MOVE cid#1557742 COPY_INSTEAD_OF_MOVE cid#1555884 COPY_INSTEAD_OF_MOVE cid#1554809 COPY_INSTEAD_OF_MOVE cid#1555336 COPY_INSTEAD_OF_MOVE cid#1555173 COPY_INSTEAD_OF_MOVE cid#1556067 COPY_INSTEAD_OF_MOVE cid#1557040 COPY_INSTEAD_OF_MOVE cid#1556235 COPY_INSTEAD_OF_MOVE cid#1557366 COPY_INSTEAD_OF_MOVE cid#1555910 COPY_INSTEAD_OF_MOVE cid#1556716 COPY_INSTEAD_OF_MOVE cid#1558022 COPY_INSTEAD_OF_MOVE cid#1555769 COPY_INSTEAD_OF_MOVE cid#1555940 COPY_INSTEAD_OF_MOVE cid#1557077 COPY_INSTEAD_OF_MOVE cid#1555270 COPY_INSTEAD_OF_MOVE cid#1555660 COPY_INSTEAD_OF_MOVE cid#1556302 COPY_INSTEAD_OF_MOVE cid#1555678 COPY_INSTEAD_OF_MOVE cid#1556538 COPY_INSTEAD_OF_MOVE cid#1557689 COPY_INSTEAD_OF_MOVE cid#1555009 COPY_INSTEAD_OF_MOVE cid#1555433 COPY_INSTEAD_OF_MOVE cid#1555671 COPY_INSTEAD_OF_MOVE cid#1555255 COPY_INSTEAD_OF_MOVE cid#1557681 COPY_INSTEAD_OF_MOVE cid#1557512 COPY_INSTEAD_OF_MOVE cid#1554958 COPY_INSTEAD_OF_MOVE cid#1555758 COPY_INSTEAD_OF_MOVE cid#1555597 COPY_INSTEAD_OF_MOVE cid#1558040 COPY_INSTEAD_OF_MOVE cid#1556476 COPY_INSTEAD_OF_MOVE cid#1557646 COPY_INSTEAD_OF_MOVE cid#1557950 COPY_INSTEAD_OF_MOVE cid#1557019 COPY_INSTEAD_OF_MOVE cid#1557885 COPY_INSTEAD_OF_MOVE cid#1556402 COPY_INSTEAD_OF_MOVE cid#1557906 COPY_INSTEAD_OF_MOVE cid#1556619 COPY_INSTEAD_OF_MOVE cid#1554683 COPY_INSTEAD_OF_MOVE cid#1556549 COPY_INSTEAD_OF_MOVE cid#1554747 COPY_INSTEAD_OF_MOVE cid#1554929 COPY_INSTEAD_OF_MOVE cid#1555362 COPY_INSTEAD_OF_MOVE cid#1557053 COPY_INSTEAD_OF_MOVE cid#1557891 COPY_INSTEAD_OF_MOVE cid#1555043 COPY_INSTEAD_OF_MOVE cid#1555107 COPY_INSTEAD_OF_MOVE cid#1557203 COPY_INSTEAD_OF_MOVE cid#1556728 COPY_INSTEAD_OF_MOVE cid#1557773 COPY_INSTEAD_OF_MOVE cid#1556845 COPY_INSTEAD_OF_MOVE Change-Id: I001fb67e597b096e992fd8a0cd6f3ec577767c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176098 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-11-06loplugin:passstuffbyref in vclNoel Grandin
Change-Id: Id152f7321bb81ecb17b31775277d1466ccd91ab4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176108 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-11-01tdf#163486: PVS: Identical branchesBogdan Buzea
V1037 Two or more case-branches perform the same actions. Check lines: 7998, 8001 Change-Id: I9ecb950ff3201265678816e42f1e7976112b7557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175305 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-10-31Fix typoAndrea Gelmini
Change-Id: If3d4810cb2a5770b5432c398a3785d8bdcf19ff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175829 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesktop@treblig.org>
2024-10-30tdf#163684 gtk3 a11y: Don't use combobox role twice for non-editable oneMichael Weghorn
Since commit 9f078ed7b625e86182d64d5ccfbb410cdd38081c Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue May 7 10:04:16 2024 +0200 tdf#160971 gtk3 a11y: Set role for custom editable combobox Set the combobox a11y role for the box in the .ui file used for the custom gtk3 combobox implementation. With this in place, moving focus to the "Font Name" or another editable combobox in the Writer toolbar now makes Orca announce that one as "editable combobox" rather than just "text". , the combobox a11y role is set for the GtkBox of the custom combobox implementation used for gtk3. That box contains the edit (for editable comboboxes) and the button. While this is needed for editable comboboxes for AT to identify this as a combobox when the edit receives focus (by the fact that the edit's parent has a combobox role), this resulted in Orca no longer announcing the combobox role when the button receives focus for non-editable comboboxes. While the button also has the combobox role, Orca has logic to not announce the role of combobox children. (`SpeechGenerator._should_speak_role` returns `false` for that case [1].) To avoid this problem and make announcement for both, editable and non-editable comboboxes work as expected, no longer set a combobox role for the box in the .ui file, but set it only for the editable combobox in the C++ code. [1] https://gitlab.gnome.org/GNOME/orca/-/blob/78e44c625ef5fb082907ca484230458624d24ee8/src/orca/speech_generator.py#L365-366 Change-Id: Ia3ff00688f47e61d5a98c79f1a256061b2fb18a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175823 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-29tdf#161152 vcl: Set CUPS "sides" option for duplex modeMichael Weghorn
When the PPD "Duplex" option is set in a print job, also set the CUPS "sides" option documented at [1], section "Printing On Both Sides of the Paper". This is apparently required for at least some Brother printers where the "Duplex" PPD option is not evaluated during the print process. [1] https://www.cups.org/doc/options.html Change-Id: Ib280c3c65eaf7bf74b611f0ce921eda51b1ebe19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175782 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-22cid#1545605 COPY_INSTEAD_OF_MOVECaolán McNamara
and cid#1545841 COPY_INSTEAD_OF_MOVE cid#1554682 COPY_INSTEAD_OF_MOVE cid#1554686 COPY_INSTEAD_OF_MOVE cid#1554715 COPY_INSTEAD_OF_MOVE cid#1554750 COPY_INSTEAD_OF_MOVE cid#1554759 COPY_INSTEAD_OF_MOVE cid#1554770 COPY_INSTEAD_OF_MOVE cid#1554779 COPY_INSTEAD_OF_MOVE cid#1554794 COPY_INSTEAD_OF_MOVE cid#1554800 COPY_INSTEAD_OF_MOVE cid#1554826 COPY_INSTEAD_OF_MOVE cid#1554836 COPY_INSTEAD_OF_MOVE cid#1554862 COPY_INSTEAD_OF_MOVE cid#1554865 COPY_INSTEAD_OF_MOVE cid#1554872 COPY_INSTEAD_OF_MOVE cid#1554883 COPY_INSTEAD_OF_MOVE cid#1554906 COPY_INSTEAD_OF_MOVE cid#1554921 COPY_INSTEAD_OF_MOVE cid#1554926 COPY_INSTEAD_OF_MOVE cid#1554946 COPY_INSTEAD_OF_MOVE cid#1554956 COPY_INSTEAD_OF_MOVE cid#1554970 COPY_INSTEAD_OF_MOVE cid#1554986 COPY_INSTEAD_OF_MOVE cid#1554991 COPY_INSTEAD_OF_MOVE cid#1555013 COPY_INSTEAD_OF_MOVE cid#1555037 COPY_INSTEAD_OF_MOVE cid#1555050 COPY_INSTEAD_OF_MOVE cid#1555057 COPY_INSTEAD_OF_MOVE cid#1555066 COPY_INSTEAD_OF_MOVE cid#1555067 COPY_INSTEAD_OF_MOVE cid#1555083 COPY_INSTEAD_OF_MOVE cid#1555097 COPY_INSTEAD_OF_MOVE cid#1555135 COPY_INSTEAD_OF_MOVE cid#1555140 COPY_INSTEAD_OF_MOVE cid#1555146 COPY_INSTEAD_OF_MOVE cid#1555148 COPY_INSTEAD_OF_MOVE cid#1555149 COPY_INSTEAD_OF_MOVE cid#1555155 COPY_INSTEAD_OF_MOVE cid#1555157 COPY_INSTEAD_OF_MOVE cid#1555168 COPY_INSTEAD_OF_MOVE cid#1555195 COPY_INSTEAD_OF_MOVE cid#1555196 COPY_INSTEAD_OF_MOVE cid#1555237 COPY_INSTEAD_OF_MOVE Change-Id: I90531c19c28dca77fe99c72efdfc0972c311da98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175377 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>