diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-12 16:55:01 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-12-12 23:02:04 +0100 |
commit | e2cd6cd7cb4457b07471c52533b73b155aa98198 (patch) | |
tree | 614c74ffe4633aadec5777fd96d3d4f56fdc9f6d /sw/source/uibase | |
parent | e9a6ed092df2a0bd761b2f459fc2179682666c90 (diff) |
sw a11y: Pass the VCLXWindow to SidebarWinAccessibleContext ctor
SwAnnotationWin::CreateAccessible returns the very
object that is calling the SidebarWinAccessibleContext
ctor.
Make that more obvious by passing it as a param instead
of calling SwAnnotationWin::CreateAccessible and then
dynamic_casting that to a VCLXWindow.
Change-Id: Id2ef80c7e5540276548c635cf550a552302b2fcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178383
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/SidebarWinAcc.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarWinAcc.hxx | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/uibase/docvw/SidebarWinAcc.cxx b/sw/source/uibase/docvw/SidebarWinAcc.cxx index d51d6848b429..0e3ad3a69e6f 100644 --- a/sw/source/uibase/docvw/SidebarWinAcc.cxx +++ b/sw/source/uibase/docvw/SidebarWinAcc.cxx @@ -31,8 +31,8 @@ namespace sw::sidebarwindows { // implementation of accessible context for <SidebarWinAccessible> instance SidebarWinAccessibleContext::SidebarWinAccessibleContext( sw::annotation::SwAnnotationWin& rSidebarWin, SwViewShell& rViewShell, - const SwFrame* pAnchorFrame) - : VCLXAccessibleComponent(dynamic_cast<VCLXWindow*>(rSidebarWin.CreateAccessible().get())) + const SwFrame* pAnchorFrame, SidebarWinAccessible* pSidebarWinAccessible) + : VCLXAccessibleComponent(pSidebarWinAccessible) , mrViewShell(rViewShell) , mpAnchorFrame(pAnchorFrame) { @@ -111,10 +111,8 @@ void SidebarWinAccessible::ChangeSidebarItem( const SwSidebarItem& rSidebarItem css::uno::Reference< css::accessibility::XAccessibleContext > SidebarWinAccessible::CreateAccessibleContext() { - rtl::Reference<SidebarWinAccessibleContext> pAccContext = - new SidebarWinAccessibleContext( mrSidebarWin, - mrViewShell, - mpAnchorFrame ); + rtl::Reference<SidebarWinAccessibleContext> pAccContext + = new SidebarWinAccessibleContext(mrSidebarWin, mrViewShell, mpAnchorFrame, this); m_bAccContextCreated = true; return pAccContext; } diff --git a/sw/source/uibase/docvw/SidebarWinAcc.hxx b/sw/source/uibase/docvw/SidebarWinAcc.hxx index b3c7dfa79700..189905f7d5fa 100644 --- a/sw/source/uibase/docvw/SidebarWinAcc.hxx +++ b/sw/source/uibase/docvw/SidebarWinAcc.hxx @@ -29,11 +29,14 @@ namespace sw::annotation { class SwAnnotationWin; } namespace sw::sidebarwindows { +class SidebarWinAccessible; + class SidebarWinAccessibleContext : public VCLXAccessibleComponent { public: explicit SidebarWinAccessibleContext(sw::annotation::SwAnnotationWin& rSidebarWin, - SwViewShell& rViewShell, const SwFrame* pAnchorFrame); + SwViewShell& rViewShell, const SwFrame* pAnchorFrame, + SidebarWinAccessible* pSidebarWinAccessible); void ChangeAnchor(const SwFrame* pAnchorFrame); |