a11y: Get text window doc accessible from Window on demand
Instead of storing a reference to the VCLXWindow (which is a TextWindowPeer), which is the EditorWindow's accessible as Document::m_xAccessible member, adjust Document::getAccessible to get the accessible on demand via vcl::Window::GetAccessible instead. This also prepares for no more passing the VCLXWindow to the ctor in an upcoming commit. Change-Id: I498f90a456eda453508a4f1ed84983006594ea86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178402 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
This commit is contained in:
@@ -319,8 +319,7 @@ public:
|
||||
Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine,
|
||||
::TextView & rView);
|
||||
|
||||
const css::uno::Reference< css::accessibility::XAccessible >&
|
||||
getAccessible() const { return m_xAccessible; }
|
||||
css::uno::Reference<css::accessibility::XAccessible> getAccessible() const;
|
||||
|
||||
css::lang::Locale retrieveLocale();
|
||||
|
||||
@@ -531,7 +530,6 @@ private:
|
||||
Paragraphs::iterator visibleEnd() { return getIter(m_nVisibleEnd); }
|
||||
Paragraphs::iterator focused() { return getIter(m_nFocused); }
|
||||
|
||||
css::uno::Reference< css::accessibility::XAccessible > m_xAccessible;
|
||||
::TextEngine & m_rEngine;
|
||||
::TextView & m_rView;
|
||||
|
||||
|
@@ -704,7 +704,6 @@ void Paragraph::checkDisposed()
|
||||
Document::Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine,
|
||||
::TextView & rView):
|
||||
VCLXAccessibleComponent(pVclXWindow->GetWindow()),
|
||||
m_xAccessible(pVclXWindow),
|
||||
m_rEngine(rEngine),
|
||||
m_rView(rView),
|
||||
m_aEngineListener(*this),
|
||||
@@ -729,6 +728,13 @@ Document::Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine,
|
||||
m_aViewListener.startListening(*m_rView.GetWindow());
|
||||
}
|
||||
|
||||
css::uno::Reference<css::accessibility::XAccessible> Document::getAccessible() const
|
||||
{
|
||||
if (vcl::Window* pWindow = GetWindow())
|
||||
return pWindow->GetAccessible();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
css::lang::Locale Document::retrieveLocale()
|
||||
{
|
||||
SolarMutexGuard aGuard;
|
||||
|
Reference in New Issue
Block a user