diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2025-04-30 16:27:55 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2025-05-01 09:52:49 +0200 |
commit | 92df695bf523a9e34b40811208c30affe4455342 (patch) | |
tree | ab8db51db62244d72a1d9a49e05158333e63d163 /basctl/source/basicide/textwindowaccessibility.cxx | |
parent | d997c4fd03d76faf4d72f29a927be43d630f3a64 (diff) |
basicide a11y: Let Document implement XAccessible, drop TextWindowPeer
No longer have TextWindowPeer as a custom VCLXWindow
subclass that gets returned in
EditorWindow::GetComponentInterface (called via
vcl::Window::CreateAccessible) and is then responsible for
creating an accessibility::Document object for its XAccessibleContext.
Instead, let the Document class which already implements
the XAccessibleContext interface also implement the
XAccessible interface (and return self in its
XAccessible::getAccessibleContext implementation)
and create the new class when an XAccessible is
requested via EditorWindow::CreateAccessible, i.e.
override vcl::Window::CreateAccessible to avoid
the VCLXWindow indirection altogether.
No change in end user behavior expected or observed
in a quick test with Basic IDE ("Tools" -> "Macros"
-> "Edit Macros") when testing with Orca and Accerciser
with the gtk3 and qt6 VCL plugins.
Change-Id: Ie6f492b523dfd404c2ac7c3a149979105cc1d43f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184839
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'basctl/source/basicide/textwindowaccessibility.cxx')
-rw-r--r-- | basctl/source/basicide/textwindowaccessibility.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/basctl/source/basicide/textwindowaccessibility.cxx b/basctl/source/basicide/textwindowaccessibility.cxx index 633cb6c1069f..e9ee3ee30bf5 100644 --- a/basctl/source/basicide/textwindowaccessibility.cxx +++ b/basctl/source/basicide/textwindowaccessibility.cxx @@ -152,7 +152,7 @@ css::uno::Reference< css::accessibility::XAccessible > SAL_CALL Paragraph::getAccessibleParent() { ensureAlive(); - return m_xDocument->getAccessible(); + return m_xDocument; } // virtual @@ -590,7 +590,7 @@ void Paragraph::implGetLineBoundary( const OUString& rText, Document::Document(vcl::Window* pWindow, ::TextEngine & rEngine, ::TextView & rView) - : VCLXAccessibleComponent(pWindow), + : ImplInheritanceHelper(pWindow), m_rEngine(rEngine), m_rView(rView), m_aEngineListener(*this), @@ -615,11 +615,13 @@ Document::Document(vcl::Window* pWindow, ::TextEngine & rEngine, m_aViewListener.startListening(*m_rView.GetWindow()); } -css::uno::Reference<css::accessibility::XAccessible> Document::getAccessible() const +css::uno::Reference<css::accessibility::XAccessibleContext> + SAL_CALL Document::getAccessibleContext() { - if (vcl::Window* pWindow = GetWindow()) - return pWindow->GetAccessible(); - return nullptr; + SolarMutexGuard aGuard; + ensureAlive(); + + return this; } css::lang::Locale Document::retrieveLocale() |