include/vcl/toolkit/treelistbox.hxx | 2 +- sd/source/ui/sidebar/MasterPagesSelector.cxx | 2 ++ starmath/source/ElementsDockingWindow.cxx | 1 + vcl/inc/iconview.hxx | 7 ------- vcl/inc/salvtables.hxx | 1 - vcl/source/accessibility/accessiblelistboxentry.cxx | 2 +- vcl/source/app/salvtables.cxx | 10 ---------- vcl/source/treelist/iconview.cxx | 10 ---------- vcl/source/treelist/treelistbox.cxx | 2 +- 9 files changed, 6 insertions(+), 31 deletions(-)
New commits: commit 8c9a2bc6074e0fdc33895a6085b491beb32a1833 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Feb 13 16:43:03 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 13 19:44:58 2025 +0100 vcl a11y: No longer report IconView item tooltip as a11y desc Now after Change-Id: I8fcbdddd74d75283469f046ff5b60f111051b021 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 13:42:05 2025 +0100 a11y: Introduce weld::IconView::set_item_accessible_name introduced API to explicitly set the a11y name for IconView items and commits Change-Id: I59275d8020d0ebd46256bdc1531849cf5be5a353 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 13:48:35 2025 +0100 svx a11y: Set accessible name for Fontwork Gallery items Change-Id: Ie54f41014822ec92576f30c72f569a8d186151c6 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 15:00:43 2025 +0100 sd a11y: Set a11y names for items in master page selector Change-Id: I74d1aa41896b70f6025fdc7e4784a2b6539ec6f6 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 15:18:10 2025 +0100 math a11y: Set a11y names for items in Elements sidebar deck implemented setting a11y names for those items which previously had no accessible name, but only an accessible description based on the tooltip, drop the fallback of using the tooltip for the accessible description of tooltip items that was originally introduced in commit 2a28ebeef5ea3e2b01d836a7233d2316b765bf38 Date: Wed Jun 1 11:18:26 2022 +0300 Accessibility for IconView and which would now result in the same text being used for the accessible name and accessible description for the above cases when the VCL implementation (SalInstanceIconView) is used. (Screenreaders usually still announce only one of them if they are the same, but the accessible description is no longer needed now.) See commit message of the above-mentioned Change-Id: I8fcbdddd74d75283469f046ff5b60f111051b021 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 13:42:05 2025 +0100 a11y: Introduce weld::IconView::set_item_accessible_name for more details. As far as I can see, the UI elements addressed by the above commits are the only ones that relied on the tooltip getting used, as other dialogs etc. using IconView pass a string/text when calling weld::IconView::insert etc., and the three ones above are the only ones calling weld::IconView::connect_query_tooltip to be able to provide a tooltip text this way. In case I missed anything and this commit results in IconView items no longer getting announced somewhere, an accessible name should presumably be set for those as well, using weld::IconView::set_item_accessible_name (s. above commits for examples). Change-Id: I153e91292ec70bb3a6dc4e1d473dc0362af55c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181636 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index 0ef5b218f045..973a93d65f50 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -459,7 +459,7 @@ public: /** Fills the StateSet of one entry. */ void FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, sal_Int64& rStateSet ) const; - virtual OUString GetEntryAccessibleDescription(SvTreeListEntry* pEntry) const; + static OUString GetEntryAccessibleDescription(SvTreeListEntry* pEntry); /** Calculate and return the bounding rectangle of an entry. @param pEntry diff --git a/vcl/inc/iconview.hxx b/vcl/inc/iconview.hxx index 438590b083ab..0ddfc9c00eb7 100644 --- a/vcl/inc/iconview.hxx +++ b/vcl/inc/iconview.hxx @@ -39,12 +39,6 @@ public: virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; - virtual OUString GetEntryAccessibleDescription(SvTreeListEntry* pEntry) const override; - void SetEntryAccessibleDescriptionHdl(const Link<SvTreeListEntry*, OUString>& rLink) - { - maEntryAccessibleDescriptionHdl = rLink; - } - virtual FactoryFunction GetUITestFactory() const override; virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override; typedef std::tuple<OUString&, SvTreeListEntry*> encoded_image_query; @@ -61,7 +55,6 @@ protected: virtual void CalcEntryHeight(SvTreeListEntry const* pEntry) override; private: - Link<SvTreeListEntry*, OUString> maEntryAccessibleDescriptionHdl; Link<const encoded_image_query&, bool> maDumpImageHdl; void DumpEntryAndSiblings(tools::JsonWriter& rJsonWriter, SvTreeListEntry* pEntry); }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 63a2748fcd79..f1651e94c664 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1926,7 +1926,6 @@ private: DECL_LINK(DoubleClickHdl, SvTreeListBox*, bool); DECL_LINK(CommandHdl, const CommandEvent&, bool); DECL_LINK(TooltipHdl, SvTreeListEntry*, OUString); - DECL_LINK(EntryAccessibleDescriptionHdl, SvTreeListEntry*, OUString); DECL_LINK(DumpImageHdl, const ::IconView::encoded_image_query&, bool); public: diff --git a/vcl/source/accessibility/accessiblelistboxentry.cxx b/vcl/source/accessibility/accessiblelistboxentry.cxx index 072bfc547463..8db62a3260ca 100644 --- a/vcl/source/accessibility/accessiblelistboxentry.cxx +++ b/vcl/source/accessibility/accessiblelistboxentry.cxx @@ -378,7 +378,7 @@ OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) { return OUString(); } - return m_pTreeListBox->GetEntryAccessibleDescription( + return SvTreeListBox::GetEntryAccessibleDescription( m_pTreeListBox->GetEntryFromPath(m_aEntryPath)); } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 373b263aea43..2218e2d37a7f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5419,8 +5419,6 @@ SalInstanceIconView::SalInstanceIconView(::IconView* pIconView, SalInstanceBuild m_xIconView->SetDoubleClickHdl(LINK(this, SalInstanceIconView, DoubleClickHdl)); m_xIconView->SetPopupMenuHdl(LINK(this, SalInstanceIconView, CommandHdl)); - m_xIconView->SetEntryAccessibleDescriptionHdl( - LINK(this, SalInstanceIconView, EntryAccessibleDescriptionHdl)); m_xIconView->SetAccessible(m_xIconView->CreateAccessible()); } @@ -5550,14 +5548,6 @@ IMPL_LINK(SalInstanceIconView, TooltipHdl, SvTreeListEntry*, pEntry, OUString) return {}; } -IMPL_LINK(SalInstanceIconView, EntryAccessibleDescriptionHdl, SvTreeListEntry*, pEntry, OUString) -{ - OUString s = SvTreeListBox::SearchEntryTextWithHeadTitle(pEntry); - if (s.isEmpty()) - s = signal_query_tooltip(SalInstanceTreeIter(pEntry)); - return s; -} - void SalInstanceIconView::connect_query_tooltip(const Link<const weld::TreeIter&, OUString>& rLink) { weld::IconView::connect_query_tooltip(rLink); diff --git a/vcl/source/treelist/iconview.cxx b/vcl/source/treelist/iconview.cxx index fde2a1a244f6..6a25976566de 100644 --- a/vcl/source/treelist/iconview.cxx +++ b/vcl/source/treelist/iconview.cxx @@ -238,16 +238,6 @@ css::uno::Reference<css::accessibility::XAccessible> IconView::CreateAccessible( return {}; } -OUString IconView::GetEntryAccessibleDescription(SvTreeListEntry* pEntry) const -{ - assert(pEntry); - - if (maEntryAccessibleDescriptionHdl.IsSet()) - return maEntryAccessibleDescriptionHdl.Call(pEntry); - - return SvTreeListBox::GetEntryAccessibleDescription(pEntry); -} - FactoryFunction IconView::GetUITestFactory() const { return IconViewUIObject::create; } static OString extractPngString(const SvLBoxContextBmp* pBmpItem) diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 4ef41e271ec1..5c4dc75fdaee 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -3504,7 +3504,7 @@ void SvTreeListBox::FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, sal_In } } -OUString SvTreeListBox::GetEntryAccessibleDescription(SvTreeListEntry* pEntry) const +OUString SvTreeListBox::GetEntryAccessibleDescription(SvTreeListEntry* pEntry) { assert(pEntry); commit db146f9856f41dba94477888853918a764a02e7a Author: Michael Weghorn <[email protected]> AuthorDate: Thu Feb 13 15:18:10 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 13 19:44:51 2025 +0100 math a11y: Set a11y names for items in Elements sidebar deck Similar to how Change-Id: I59275d8020d0ebd46256bdc1531849cf5be5a353 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 13:48:35 2025 +0100 svx a11y: Set accessible name for Fontwork Gallery items did for the Fontwork Gallery, set a11y names for the items in Maths "Elements" sidebar deck (e.g. the mathematical operators,...). Use the text also used for the help text/tooltip (e.g. "+ Sign"), s. `QueryTooltipHandler`. Change-Id: I74d1aa41896b70f6025fdc7e4784a2b6539ec6f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181635 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index f202d1bd74e0..f96d4647c0b9 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -595,6 +595,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin maItemDatas.push_back(std::make_unique<ElementData>(aElementSource, aHelpText, maItemDatas.size())); const OUString aId(weld::toId(maItemDatas.back().get())); mpIconView->insert(-1, nullptr, &aId, pDevice, nullptr); + mpIconView->set_item_accessible_name(mpIconView->n_children() - 1, GetElementHelpText(aId)); if (mpIconView->get_item_width() < aSize.Width()) mpIconView->set_item_width(aSize.Width()); } commit 6c22b1abff20ff4b07e51119cf158a71ca75c371 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Feb 13 15:00:43 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Feb 13 19:44:45 2025 +0100 sd a11y: Set a11y names for items in master page selector Similar to how Change-Id: I59275d8020d0ebd46256bdc1531849cf5be5a353 Author: Michael Weghorn <[email protected]> Date: Thu Feb 13 13:48:35 2025 +0100 svx a11y: Set accessible name for Fontwork Gallery items did for the Fontwork Gallery, set a11y names for the items in the IconView in the Impress master page selector ("Master Slides" deck in the Impress sidebar). Use the page name as the a11y name, which also gets used for the tooltip, s. `QueryTooltipHdl`. Change-Id: Ie54f41014822ec92576f30c72f569a8d186151c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181623 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index c65eb4d19bd7..e429dfa4aec3 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -402,6 +402,8 @@ void MasterPagesSelector::SetItem ( { OUString sId = OUString::number(aToken); mxPreviewIconView->insert(nIndex, nullptr, &sId, pVDev, nullptr); + mxPreviewIconView->set_item_accessible_name( + nIndex, mpContainer->GetPageNameForToken(aToken)); } AddTokenToIndexEntry(nIndex, aToken);
