2202 Commits
Author SHA1 Message Date
Marios 3f568ed6c4 tdf#171853 Use endsWith instead of checking lastIndexOf at string in fpicker
Change-Id: Idb8ffafa585bdb032ddb9c187b29eb5fb0a3f45d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209462
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
2026-09-22 09:14:53 +02:00
Michael Weghorn 312aac710b Move SvtViewOptions from unotools to svtools
The SvtViewOptions class is used to store the state
of windows/dialogs.

So far, SvtViewOptions::SetWindowState and
SvtViewOptions::GetWindowState are string-based
and the callers are responsible for (de)serializing
the vcl::WindowData to/from string.

This will be changed to become the responsibility
of SvtViewOptions in an upcoming commit.

Since unotools is below vcl in the module
dependency chain, it cannot make use of vcl,
i.e. vcl::WindowData couldn't be used there.

Therefore, move SvtViewOptions from unotools
to svtools, which is above vcl in the module
dependencies.
(svtools/README.md summarizes the purpose of the
module as "Tools on the Top of VCL", which seems
an appropriate place for helper code to manage
the state/options for dialogs, tab pages,...)

Change-Id: If849224c35c7ac895659ddb7c17e6d17061d61a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208124
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-15 14:45:41 +02:00
Michael Weghorn f1f6a505a0 weld: Pass weld::TextWidget& in text change callback/handler
Switch the weld::Entry and weld::TextView handlers
that are called when the text changes due to user
interaction to pass a weld::TextWidget& param
instead of a weld::Entry& and weld::TextView&
one respectively.
Adjust related methods across the code base accordingly.

This unifies the behavior for both of these
weld::TextWidget subclasses and prepares for
deduplicating the logic and moving it to the
common base class in an upcoming commit.

That will also ensure they stay in sync.
(Change also motivated by the fact that their behavior was
differing before

    Change-Id: I03d2a13cd84d53d806eb9e363f49c4b6be28d938
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Jul 9 13:08:58 2026 +0200

        tdf#130857 weld: Don't signal about programmatic TextView text change
.)

Change-Id: I5572fc88caf577fae9a23a39f1ec4f2179935a99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207936
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-10 18:17:27 +02:00
Michael Weghorn 2dca1c0f02 weld: Rename TreeView *_column_clicked methods to *_column_header_clicked
Rename weld::TreeView::connect_column_clicked
and weld::TreeView::signal_column_clicked to make
clear that they are not about a click anywhere in a
column, but about the column *header* being clicked.

The GTK 4 doc for the corresponding
GtkTreeViewColumn::clicked signal [1] by which the API
was apparently inspired is clear about this:

> Emitted when the column’s header has been clicked.

[1] https://docs.gtk.org/gtk4/signal.TreeViewColumn.clicked.html

Change-Id: I0b4b337b5ca938bb1526d9857ed2b0b244daf23c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207591
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-03 22:26:00 +02:00
Xisco Fauli 6ac93e562a normalize some namespace declarations
Change-Id: I4cc17f852dd58d95e97cdc673d1f1ca0c6de6c03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206636
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-15 22:35:56 +02:00
Michael Weghorn f26084217a weld: Move weld::Button to own header/Rename weld.hxx
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses.

By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when one class changes.

By now, only weld::Button is left in weld.hxx.
Rename the header to Button.hxx.
Drop weld.hxx includes and instead add Button.hxx
includes (or weld::Button forward declarations) where
weld::Button is used.
(Don't simply replace all weld.hxx includes with
Button.hxx ones, since many of them were for the
use of other widgets that have since been moved
to their own headers.)

Add further includes where needed now that the
(direct or transitive) includes of weld.hxx were removed.

Change-Id: I8ea6201446a418d5e38b46337059dcd517ee29d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205937
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-06-05 07:58:07 +02:00
Michael Weghorn 8b5a46a0e0 weld: Move weld::toId and weld::fromId to weldutils.hxx
In the past, weld.hxx used to contain the class
definitions for weld::Widget and all subclasses,
as well as a few helpers.

By now, weld::Widget and almost all subclasses have
been moved to separate headers, to make it easier
to keep the overview and to avoid having to
recompile ~all UI code when anything in weld.hxx
changes.

Move the weld::toId and weld::fromId helpers from
weld.hxx to weldutils.hxx, in preparation of getting
rid of weld.hxx altogether in an upcomcing commit.

Change-Id: I408fe20a74ff104cbfe07bde3105317a1922ff61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205936
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-06-04 14:37:13 +02:00
Michael Weghorn 8f7cf9c32c weld: Move weld::CheckButton to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Add missing includes/forward declarations in places
previously depending on transitive includes that
are now dropped.

Change-Id: I3215b358e0fa45ffce08756218c386e1a4d7ebc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205928
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-06-04 08:39:19 +02:00
Michael Weghorn 1d271b2c15 weld: Move weld::ToggleButton to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I52a953858a997f8549d12fa3d6ed23cc1fb236c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205904
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-06-03 23:20:02 +02:00
Michael Weghorn 911a89ddeb weld: Move weld::WaitObject to own header/source
Move the class out of weld.hxx into its own header and
source file, in order to make it easier to keep an overview
and to avoid having to recompile ~all UI code when the class
is modified.

Change-Id: I91bae842e5b18a83db45de12150c21f75e537fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205900
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-06-03 23:19:30 +02:00
Michael Weghorn 243bb112ec weld: Move weld::Container to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Adjust includes in files that were implicitly depending
on transitive includes that are no longer present because
the more specific include/weld/Container.hxx is included
further down now instead of include/weld/weld.hxx.

Change-Id: I04e6bb72ce446b746dfdf88b45c7df9d0ccda473
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205899
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-06-03 23:19:22 +02:00
Michael Weghorn 336f70f966 weld: Move weld::Label to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ide86f35543468a88288a068cc9f89eaf381ac52f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205763
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-27 22:24:37 +02:00
Michael Weghorn 68ce3cfcb1 weld: Move weld::LinkButton to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I6d9323c56bca95734a1b60daa60085547f212a66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205485
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-22 21:56:19 +02:00
Michael Weghorn b2ce99c623 weld: Move weld::Image to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I2eb564b2483b052f01d4af55fd4feb00b5ed6031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205472
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-05-22 21:55:53 +02:00
Michael Weghorn 3f1fb9d4b0 weld: Move weld::Window to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: If7cb4403f1861c465f44a1cae4065b0bf8dfad48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205323
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-19 09:10:43 +02:00
Asim Raza 4f54b40041 tdf#163691 Use std::copy_n() instead of memcpy() in FilterContainer.cxx
Change-Id: I951feec6eb86c7532b9619ef3b354dc3e33d0883
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204341
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-29 10:31:51 +02:00
Michael Weghorn 6ea49cb1bd weld: Pass col index in TreeView::signal_editing_done
In addition to the weld::TreeIter and the new text,
also pass the column index of the cell that was edited
in the callback that gets called when a cell was edited.

This will allow callbacks to take that into account as
well when deciding whether to accept or reject the
editor operation.

One case that will make use of this in an upcoming
commit is Math's MatrixCreatorDialog, which currently
implements its own logic based on mouse clicks to
(try to) identify the column that is edited.
That is relatively complicated and won't work in the
case of keyboard-only interaction.

For the vcl implementation, this makes use of the
SvLBoxItem available in the callback since

    Change-Id: Iad2866d8fcc710d82f4f0dc0661a3b1f0bebaeab
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Apr 24 13:17:15 2026 +0200

        vcl: Also pass the item in treeview callback when entry edited

to retrieve the column index of the modified
item/cell.

For GTK, GtkInstanceTreeView::signal_cell_toggled
already contains similar logic.

For Qt, the column index is available via the
QModelIndex.

Change-Id: I36fa296d72ef2ff853da03037151cc060634d2a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204305
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-04-26 18:09:35 +02:00
Michael Weghorn 675d216886 Use existing weld::TreeView::iter_string typedef
Use the existing typedef instead of having multiple
versions that are all the same.

Change-Id: I7bc99a641ce5e7aa8237968b8b88fa4835917cd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204288
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-26 18:07:59 +02:00
Michael Weghorn 6edfb00862 weld: Switch IconView selection changed signal param to ItemView
Switch the param for the signal and handlers used when
the selection in a weld::IconView changes from weld::IconView&
to the base class, weld::ItemView&.

This is in preparation of moving the logic to the weld::ItemView
base class in an upcoming commit.

This is the IconView equivalent of previous commit

    Change-Id: I0bbf8fe1dbd95906a5224155d48d832bcd144532
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Apr 9 13:45:18 2026 +0200

        weld: Switch TreeView selection changed signal param to ItemView

Change-Id: I87fad3a129128d4387adfdd75d18e93f05af5e84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203367
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-10 06:36:33 +02:00
Michael Weghorn 03d5d803c4 weld: Switch TreeView selection changed signal param to ItemView
Switch the param for the signal and handlers used when
the selection in a weld::TreeView changes from weld::TreeView&
to the base class, weld::ItemView&.

This is in preparation of moving the logic to the weld::ItemView
base class in an upcoming commit.

Handler implementations that require a weld::TreeView
instance can use the one that the signal is connected
to, e.g. use the class member directly inside of the
implementation instead of using the param (as is done
in most of the places anyway).

Change-Id: I0bbf8fe1dbd95906a5224155d48d832bcd144532
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203366
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-10 06:36:08 +02:00
Michael Weghorn 8ff8ad952e weld: Rename row activation related TreeView members to match IconView
Rename methods and field related to signalling activation
of a weld::TreeView row to use the same names as the equivalent
ones for signalling activation of an entry in weld::IconView:

* weld::TreeView::m_aRowActivatedHdl -> weld::TreeView::m_aItemActivatedHdl
* weld::TreeView::signal_row_activated -> weld::TreeView::signal_item_activated
* weld::TreeView::connect_row_activated -> weld::TreeView::connect_item_activated

This is in preparation of deduplicating the weld::TreeView
and weld::IconView implementations for these by moving them
to the common weld::ItemView base class in an upcoming commit.

Change-Id: I4ca4dec1295c57cea574b68fd41b89c12144c4f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203350
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-10 06:29:43 +02:00
Michael Weghorn 11789e47ac weld: Pass activated row in TreeView::signal_row_activated
This is basically the weld::TreeView version of earlier
commit

        Change-Id: I8ca62ac32108f01e2055d5ef9301de22eb5b1931
        Author: Michael Weghorn <m.weghorn@posteo.de>
        Date:   Wed Apr 8 12:35:25 2026 +0200

            weld: Pass activated item in IconView::signal_item_activated

applying an equivalent change for weld::IconView instead
of weld::TreeView. See that commit for more details/background.

For weld::TreeView, the weld::TreeIter refers to
a full row (and columns are handled separately
by a column index in the weld::TreeView API).

As for the above commit:
Initially, leave the logic of the existing signal handlers/callbackes
(in dialog implementations) unchanged. At least some of them
will be simplified in upcoming commits to use the
newly passed weld::TreeIter param directly instead of
determining the current/activated row a different
way.

Change-Id: Ie6a962702d4f7f069b2f7b77a22a78722b2a6408
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203331
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-09 10:21:45 +02:00
Michael Weghorn f792e696b4 weld: Pass activated item in IconView::signal_item_activated
So far, the IconView::signal_item_activated was called
with the weld::IconView itself as a parameter, i.e.
the information what item was selected wasn't directly
passed to the signal handlers.

Change that to pass a weld::TreeIter param referring to the
activated item instead of the IconView itself.

The information what item was activated is relevant
and this way, there is no need to determine it some
other way in the handlers (e.g. by using the first
selected entry).

This also aligns this more with what UI toolkits
like GTK and Qt provide.

For GTK, the GtkIconView::item-activated signal [1]
has the path of the activated entry.

For Qt, the QAbstractItemView::activated signal [2]
has the QModelIndex of the activated item.

For the vcl implementation in SalInstanceIconView::DoubleClickHdl,
use the cursor/current item.

In LOKTrigger::trigger_item_activated, use the currently selected
entry (retrieved via weld::IconView::get_selected), because the
only caller in jsdialog::ExecuteAction uses weld::IconView::select
first to select an entry before triggering the signal.

Initially, leave the logic of the existing signal handlers/callbackes
(in dialog implementations) unchanged. At least some of them
will be simplified in upcoming commits.

[1] https://docs.gtk.org/gtk3/signal.IconView.item-activated.html
[2] https://doc.qt.io/qt-6/qabstractitemview.html#activated

Change-Id: I8ca62ac32108f01e2055d5ef9301de22eb5b1931
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-04-09 10:19:36 +02:00
Gabor Kelemen 6e9fa580f0 tdf#146619 Use more forward declarations in include/svtools
Change-Id: If91cce7bf7ece7d1c125509118cbbe1a9ee65397
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198971
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-02-17 09:13:52 +01:00
Michael Weghorn fbcfd00fb7 weld: Move weld::Dialog to own header/source
Move the class out of weld.hxx into its own header and source
file, in order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ic47dac553fc065c5c9cddbf31e33012314dbe43d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199073
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-02-11 07:32:57 +01:00
Michael Weghorn ab3635b2f3 weld: Move weld::MessageDialog to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I5b23b02151c75bb49831a2bbf8d515eb0b54415e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199068
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-02-11 07:32:45 +01:00
Michael Weghorn 619b5f60bb weld: Move weld::MenuButton to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I47ea75ca8aedc7409a262fc72afcfbc0accef4ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199050
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-02-10 23:51:22 +01:00
Michael Weghorn 2866ba3e83 weld: Move weld::Menu to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I86edb8abe2178862269f2fc2a1629fb682a6a752
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198790
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-02-06 10:14:33 +01:00
Gabor Kelemen 76eb42c5aa tdf#146619 Use more forward declarations in include/svl
This shaves off some 40M of input

Change-Id: I89411ee8d94963ec6bc16fe155c885d2c78ee3a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198233
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-31 16:36:16 +01:00
Gabor Kelemen 495fa42afa tdf#146619 Use more forward declarations in include/vcl/weld/
after recent split of these headers

This shaves off another 150M input

Change-Id: Ia4e42781cdc6fd6e795c9fb55c6c24dd641b8f0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197339
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-31 11:06:42 +01:00
Mike Kaganski ed98a5519e Drop some more typedefs
Makes the code more clear.

Change-Id: I5336503ab929b7d24701b831e3ad687fd84583bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198047
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-01-24 18:49:15 +01:00
Mike Kaganski 3b5d452ae2 Drop a typedef used only once
Change-Id: Ifd1fff885d308e5376f600e617a26c90c093ab4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198045
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-01-24 18:40:21 +01:00
Mike Kaganski 0a0b3a14dd Use TOpenDialogImpl for folder picker, too
Its only difference from its base is getResult, which also tries
to use IFileOpenDialog::GetSelectedItems/GetResults, which is OK
for folder picker.

Change-Id: I6acbcb64a2de4025dcac8022b26355d6444f5082
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198044
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2026-01-24 18:00:13 +01:00
Mike Kaganski dbfc645ad8 Simplify a bit
Change-Id: I350162e56f403fd0a28a5df7da304f0ae31f21d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198043
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-01-24 17:17:42 +01:00
Mike Kaganski 3a54d9870f Simplify use of COMReference a bit
1. Avoid explicitly specifying COM_QUERY in calls to QueryInterface
   (it is implied from the name).
2. Drop redundant ctor and set() that duplicate QueryInterface.
3. Allow ThrowIfFailed without a message.

Change-Id: I75b545e534efb7e57da131dfd40a2a49d204efac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198033
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2026-01-24 13:36:50 +01:00
Gabor Kelemen 3fc666e120 Fix some non self contained headers in modules [a-r]*
Change-Id: I844cfcfa2bc31fae0256e0c7b757b6223ac8ac35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196633
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
Tested-by: Jenkins
2026-01-18 00:34:04 +01:00
Gabor Kelemen b63115f3fa tdf#146619 Use more forward declarations in include/vcl/[d-g]*
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[d-g]*

This shaves off about 150M input

Change-Id: I2b15257451d4b392dca3e5d07f4a443ee653b04c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196395
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
2026-01-11 21:38:37 +01:00
Michael Weghorn 3bbc98757a weld: Move weld::Toolbar to own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ie54aef229609f131d3d53874c9390339566880f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196947
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-01-10 23:19:56 +01:00
Michael Weghorn ffc8326e99 weld: Move weld::Entry to own header/source
Move the class out of weld.hxx into its own header and source
file, in order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I27033905fe8be1c3646c8cf08799c9bf53eeb471
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196448
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-01-04 15:03:39 +01:00
Michael Weghorn b44a20cdb7 weld: Move weld::ComboBox to own header/source
Move the class out of weld.hxx into its own header and source
file, in order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ib2fe4a6b5e34ad8ae2194ba85249ca25ed16e9d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196435
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2026-01-03 08:12:10 +01:00
Michael Weghorn af9d93ecb4 weld: Return std::unique_ptr in weld::ItemView::get_cursor
This is similar to

    commit 82edaf048b
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Sun Dec 21 01:36:30 2025 +0100

        weld: Return std::unique_ptr in weld::ItemView::get_selected

, but now for weld::ItemView::get_cursor.

See the above-mentioned commit for more background.

Change-Id: I6a8d8daa3dd3326c2716c0c0b4e4cb424f73ecb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196389
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-01-03 08:11:27 +01:00
Caolán McNamara 2cce753572 cid#1677826 silence Argument cannot be negative
and

cid#1677825 Argument cannot be negative
cid#1677824 Argument cannot be negative

Change-Id: I7be698d1950574765c5c5e5e45b8ea92a403bb0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196184
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-12-24 03:16:39 +01:00
Michael Weghorn 82edaf048b weld: Return std::unique_ptr in weld::ItemView::get_selected
So far, the method had a weld:::TreeView* out param
and a bool return value, which indicated whether
or not a selected item actually exists (and was
set in the passed TreeIter).

Drop the method param and instead return a
std::unique_ptr<weld::TreeIter>. If it doesn't
own a pointer, there is no selection (i.e. the
case previously indicated by a `false` return
value). If it owns a weld::TreeIter, then
that one points to the (first) selected item.

This simplifies using this as it is no longer
necessary to separately create weld::TreeIter to
pass as an out param first, e.g.

    std::unique_ptr<weld::TreeIter> pEntry = rMyIconView.make_iterator());
    if (rMyIconView.get_selected(xEntry.get()))
    {
        // do sth
    }

now turns into

    if (std::unique_ptr<weld::TreeIter> xEntry = rMyIconView->get_selected())
    {
        // do sth
    }

Adjust all callers accordingly.

It might be worth looking into doing something
similar for other methods (e.g.
weld::ItemView::get_iter_first) as well.

Change-Id: I83146fc8d68a92d50eed9bd635bf91b1450ce495
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196039
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-22 09:18:39 +01:00
Michael Weghorn 93787a0aac weld: Move weld::Builder to its own header
Change-Id: I89270c89f65e55fea6ad67e74f87d29fbf50c1e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195844
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-12-18 19:44:51 +01:00
Michael Weghorn 5454b7ed94 weld: Move weld::DialogController and subclasses to own header/source
This is also in preparation of moving weld::Builder to
its own header.

Change-Id: Icb65ee85376d17e1abead2c6339f78b129112d0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195841
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-12-18 19:44:41 +01:00
Michael Weghorn 4e630100fd weld: Move weld::TreeView to its own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: Ifbd413fc8dcfe5e453a0fef8a04f3c396af4c836
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195781
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
2025-12-17 18:20:41 +01:00
Michael Weghorn 914b050943 weld: Move weld::IconView to its own header
Move the class out of weld.hxx into its own header, in
order to make it easier to keep an overview and to avoid
having to recompile ~all UI code when the class is
modified.

Change-Id: I933b5ec749036bc02c7de7bc3528e6cd4a6e0fb7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195779
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-17 18:20:27 +01:00
Michael Weghorn 5b16b3acc6 weld: Move weld.hxx and weldutils.hxx to new include/vcl/weld subdir
This is in preparation of moving code out of weld.hxx
to separate headers/source files, in order to make it
easier to keep an overview and to avoid having to
recompile ~all UI code when anything changes.

Also move weldutils.cxx to a new vcl/source/weld
directory.

Change-Id: Ia75b42f21e560dd248307282a522f186a64cd742
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195777
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-17 18:20:13 +01:00
Michael Weghorn 78461f9db0 tdf#130857 weld: Reuse existing weld::Widget command logic for TreeView
Drop the weld::TreeView-specific logic for signalling
CommandEvent of type ContextMenu and reuse the existing
logic implemented in the weld::Widget base class instead,
which was moved there in previous commit

    Change-Id: I9367bdbb8be7994057667fab539aaf135751e063
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Dec 10 23:08:21 2025 +0100

        tdf#130857 weld: Move CommandEvent handling to weld::Widget base

Make weld::Widget::connect_command virtual to override
it in GtkInstanceTreeView, as was previously the case
for the now dropped weld::TreeView::connect_popup_menu.

The existing handlers previously connected using
weld::TreeView::connect_popup_menu already check whether the type
of the event is CommandEventId::ContextMenu, so no change in behavior
is expected.

In a quick test, the sample scenario of the template dialog as
described in

    commit 5d28767654
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Tue Dec 9 20:13:07 2025 +0100

        tdf#130857 qt weld: Forward TreeView context menu event

still worked as expected with gtk3 and gen as well as with
an experimental branch for qt6 where support for using native
Qt widgets for that dialog is declared.

Change-Id: I13baf51eda2c9f0adc9c167ab50e920d23ada07e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195415
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-12-12 13:25:45 +01:00
Mike Kaganski b280efcb9b Drop some uses Sequence::getConstArray
Replace by operator[], begin() and end(), which don't have overhead
since commit 2484de6728 (Remove non-
const Sequence::begin()/end() in internal code, 2021-10-15)
and commit fb3c04bd19 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).

Change-Id: I221470b3439bb0dc6e7705b0d99deb3cd2063484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195176
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2025-12-07 12:54:23 +01:00