[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - vcl/source
Attila Szűcs (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 20 13:00:13 UTC 2021
vcl/source/treelist/treelistbox.cxx | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
New commits:
commit 84757610daa040eb3aa7aa5b5902697ee2cf83e1
Author: Attila Szűcs <szucs.attila3 at nisz.hu>
AuthorDate: Fri Oct 16 09:54:14 2020 +0200
Commit: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Tue Apr 20 14:59:37 2021 +0200
tdf#116675 vcl tree list: toggle by label click (e.g. in AutoFilter)
Checkboxes in a tree list could be toggled only by clicking
on them, but not on the associated labels, despite UX guidelines
and interoperability requirements especially for AutoFilter usage
in the spreadsheet.
Note: Implemented only for generic VCL plugin. Testing on Linux:
SAL_USE_VCLPLUGIN=gen instdir/program/soffice
Co-authored-by: Tibor Nagy (NISZ)
Change-Id: Ibc3d42271a1be53a54e11dedf4ab3ab506d680cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104414
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
(cherry picked from commit 2471d6f44c7e8ecbe86a90eeb593b899a08a7408)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114287
Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index bb52e28fe0d4..bbece8b674d9 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -2329,6 +2329,29 @@ void SvTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
void SvTreeListBox::MouseButtonUp( const MouseEvent& rMEvt )
{
+ // tdf#116675 clicking on an entry should toggle its checkbox
+ if (rMEvt.IsLeft() && (nTreeFlags & SvTreeFlags::CHKBTN))
+ {
+ const Point aPnt = rMEvt.GetPosPixel();
+ SvTreeListEntry* pEntry = GetEntry(aPnt);
+ if (pEntry && pEntry->m_Items.size() > 0)
+ {
+ SvLBoxItem* pItem = GetItem(pEntry, aPnt.X());
+ // if the checkbox button was clicked, that will be toggled later, do not toggle here
+ // anyway users probably don't want to toggle the checkbox by clickink on another button
+ if (!pItem || pItem->GetType() != SvLBoxItemType::Button)
+ {
+ SvLBoxButton* pItemCheckBox
+ = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button));
+ if (pItemCheckBox)
+ {
+ pItemCheckBox->ClickHdl(pEntry);
+ InvalidateEntry(pEntry);
+ }
+ }
+ }
+ }
+
pImpl->MouseButtonUp( rMEvt );
}
More information about the Libreoffice-commits
mailing list