Together with the expanded state, SvLBoxContextBmp::m_bExpanded
is used in SvLBoxContextBmp::Paint to decide which image
(SvLBoxContextBmp::m_aImage1 or SvLBoxContextBmp::m_aImage2)
to draw.
There are 2 actual scenarios used for that member:
1) The member is set to true, with (potentially) different images
set. (Used in ImplContextGraphicItem.)
2) The member is set to false, with the same image
set for both images. (Used in SalInstanceTreeView
and SalInstanceIconView).
For 2), it doesn't matter which of the two images is used,
as they are the same anyway.
For 1), the
const Image& rImage = pView->IsExpanded() != m_bExpanded ? m_aImage1 : m_aImage2;
can be simplified to just
const Image& rImage = !pView->IsExpanded() ? m_aImage1 : m_aImage2;
to make more obvious that SvLBoxContextBmp::m_aImage1 is
used for the case where the entry is not expanded and
SvLBoxContextBmp::m_aImage2 is used when the entry is expanded.
Drop SvLBoxContextBmp::m_bExpanded to simplify this accordingly.
Change-Id: I94b06ef87f002a1f35591021225d1858631afb44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206969
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Use SvTreeListBox::Insert directly, which is perfectly fine
with a null parent param (at least) with previous changes
up to
Change-Id: I07e12a6f3b3e9c96df79129e19f9331a64588830
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Jun 17 10:25:17 2026 +0200
vcl: Consolidate to one SvTreeListBox::Insert
in place.
Change-Id: I6c4a68a23b36df66635ef8836ffc45c7a751ef29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206791
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Change the order of the 2nd and 3rd parameter
of SvTreeList::Insert and SvTreeListBox::Insert.
This prepares for providing a default value of
nullptr for the third parameter in
SvTreeListBox::Insert and dropping the
SvTreeListBox::Insert variant that only takes
2 params.
Change-Id: Ibea425c37a856cbece484fc2f7fbcd12b42ea235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206788
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
That one already gets the model to call
SvTreeList::InvalidateEntry, so no need to
do that manually in more places.
Change-Id: I52c8b883353b8eec19c642ff7a00ddb3fbd01802
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206748
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Use the existing SvTreeListBox method that removes
the entry from the model instead of manually
removing from the model directly.
This requires to pass a non-const SvTreeListBox
to TreeControlPeer::updateChildNodes.
Change-Id: Idefc7f25a5d22bcba765541c73101e888d42e225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206741
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This makes clear that this is always non-null.
The method implementation unconditionally dereferences
the argument.
Change-Id: I5c0e2576b3abf4347cd18349b79656ab73bae5d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206723
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Just hard-code passing true to the base class ctor as the
ImplContextGraphicItem ctor is always called with a value
of true.
Change-Id: I5437e049daf570d693445a7431ed61f17b6dfffa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206397
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Return early if mpTreeImpl is null, which allows
to get rid of one nesting level further down.
Change-Id: I75fa1d7838bb83fe1340935f2f3db09f86a45253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206311
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
`Nodes` is created with the default Sequence ctor, i.e.
as an empty Sequence. Since no element is inserted afterwards,
it is still empty and has no element, so there is no point
in checking whether it has any.
Drop the corresponding logic altogether.
Change-Id: I3c5e83c950d383251f713fd6ddb20554e7ad2a97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204923
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
All 4 callers check whether TreeControlPeer::mnEditLock
is non-zero and return early in that case. Deduplicate
that by moving the check into TreeControlPeer::updateTree
itself.
Change-Id: I650e2a9e2d256a609290e288ba850f490d071929
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204922
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
The methods overriden here are from the
css::awt::tree::XTreeDataModelListener UNO interface.
Clarify the comment in the header, and drop the
duplicate comment in the source file.
Change-Id: I0481202df14601935601f69b38099f58db5d80d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204920
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
So far, the callback called when a SvTreeListBox
entry was edited contained the SvTreeListEntry
and the new text of the entry.
Pass also the entry's item (SvLBoxItem) in addition,
so the handler can take that into account.
This will be used in an upcoming commit to extend
weld::TreeView::signal_editing_done to also pass
the index of the edited column.
Change-Id: Iad2866d8fcc710d82f4f0dc0661a3b1f0bebaeab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204303
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Switch SvTreeListBox::EditedEntry to take a reference instead
of pointer param and also use a reference in IterString.
Change-Id: I9597ff94978c4f25440d1b41b8c99985928258e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204295
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Similar to previous commit
Change-Id: Id39e551d54f4dc20ab7d7e33d52ed5cea308e1ce
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Apr 24 12:12:01 2026 +0200
vcl: Return ref in SvTreeListBox::GetViewDataItem
, also switch the non-const variant to return a reference
instead of a pointer.
Change-Id: I31bef6a251c873c220171e17db1dfd4a82ddadbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204292
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
... instead of by pointer.
This also allows to drop one superfluous null check
in SvLBoxButton::InitViewData.
Change-Id: Iefbfc4c701effefbc618f2eaa0b101edbd6ee176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202346
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Move helpers to convert between the Rectangle, Point and Size
classes in vcl and in css::awt from VCLUnoHelper (in the toolkit module)
to vcl::unohelper (in the vcl module), for reuse in vcl in upcoming
commits.
Change-Id: I7b11c8a6b8c843a01ce25b1e4c0fb1869ad1e6ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177816
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Since
commit 32cd4a92ef
Author: Jens-Heiner Rechtien <hr@openoffice.org>
Date: Wed Jun 27 11:18:37 2007 +0000
INTEGRATION: CWS awttree01 (1.1.2); FILE ADDED
V524 It is odd that the body of 'removeSelectionChangeListener' function is fully equivalent to the body of 'addSelectionChangeListener' function.
Change-Id: I807520da4515ae8dfb070b29aa772bab1ade592b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175254
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Following
Change-Id: Id48f81deb05aee2026509037f7d14575735e5be0
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Wed Jul 10 14:49:03 2024 +0200
VCLUnoHelper: Align AWT <-> VCL helpers with convert.hxx impl
, port all uses of the helper functions defined in
`include/toolkit/helper/convert.hxx` to use the
`VCLUnoHelper` equivalents instead, to unify usage
and avoid duplication.
Drop `include/toolkit/helper/convert.hxx` now that
it's unused.
Change-Id: I22695a93e40e47bb2b14d191a2e0a4eb7c856895
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170317
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
We are talking about a tree list in a gui which logically will not exceed sal_uInt32
They also must be unsigned integers because they represent counts & positions
changes are done to these variables:
- nPos (node position)
In all base classes you will found that all functions deal with and return sal_int32 concerning it
- nChild (node child)
It is assigned to TREELIST_APPEND which is MAX for sal_uInt32 and it is considered like that in all other functions
- nSelectionCount
all functions that deal with it (like GetSelectionCount()) returns sal_uInt32
Change-Id: I1771b9aa52c351063d007d7014484861d4b3e02a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164067
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
we can drop the lock immediately after construction (since
the iterator holds a thread-safe COW link to the underlying listener
container)
Change-Id: I08f8fa9ed7393747938572097f3c25f5f3f847fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151440
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Which means creating a variant of the cppuhelper::OPropertySetHelper
helper class which uses a std::mutex.
Since we can do virtual base classes now (which the original could not), use that and a new helper
class comphelper::UnoImplBase to share
std::mutex m_aMutex;
bool m_bDisposing;
fields that the OPropertySetHelper wants to share with the parent class.
Change-Id: I05ad465a3d3653ed4e109137e3e1c58190da8d97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148474
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
The base UnoControl uses WeakAggImplHelper9, so (for better or worse) derives
from XAggregation, but UnoGridControl, UnoRoadmapControl, and UnoTreeControl all
failed to properly implement the XAggregation protocol.
Change-Id: Ia1676782e616216f645dc86ba978c2f5887dc508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145767
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: I33fc079e2128c678ecc36567c2c5ed75481694c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144752
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>