Files
odfstudio/toolkit/source/controls
Michael Weghorn 32ec401003 vcl: Drop SvLBoxContextBmp::m_bExpanded
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>
2026-06-20 22:23:14 +02:00
..