a11y: Pass vcl::Window instead of VCLXWindow for TextWindow a11y

As was done for the other a11y classes subclassing
VCLXAccessibleComponent in

    commit 168512dce7
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Thu Dec 12 18:06:13 2024 +0100

        a11y: Stop using VCLXWindow in vcl a11y classes

, also pass the vcl::Window when creating an
XAccessibleContext for a TextView, to get rid of
the UNO/toolkit dependency.

Change-Id: I3c5febd27a53fe17f83cc4e95dd7466f11a7a225
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178403
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2024-12-13 09:53:34 +01:00
parent 667823e412
commit cd76d6caaf
5 changed files with 10 additions and 10 deletions

View File

@@ -316,8 +316,7 @@ typedef std::unordered_map< OUString,
class Document final : public ::VCLXAccessibleComponent, public ::SfxListener class Document final : public ::VCLXAccessibleComponent, public ::SfxListener
{ {
public: public:
Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine, Document(vcl::Window* pWindow, ::TextEngine & rEngine, ::TextView & rView);
::TextView & rView);
css::uno::Reference<css::accessibility::XAccessible> getAccessible() const; css::uno::Reference<css::accessibility::XAccessible> getAccessible() const;

View File

@@ -701,9 +701,9 @@ void Paragraph::checkDisposed()
OUString(), getXWeak()); OUString(), getXWeak());
} }
Document::Document(::VCLXWindow * pVclXWindow, ::TextEngine & rEngine, Document::Document(vcl::Window* pWindow, ::TextEngine & rEngine,
::TextView & rView): ::TextView & rView)
VCLXAccessibleComponent(pVclXWindow->GetWindow()), : VCLXAccessibleComponent(pWindow),
m_rEngine(rEngine), m_rEngine(rEngine),
m_rView(rView), m_rView(rView),
m_aEngineListener(*this), m_aEngineListener(*this),

View File

@@ -146,7 +146,7 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessibleContext > virtual css::uno::Reference< css::accessibility::XAccessibleContext >
createAccessibleTextWindowContext( createAccessibleTextWindowContext(
VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView vcl::Window* pWindow, TextEngine& rEngine, TextView& rView
) const override; ) const override;
virtual css::uno::Reference< css::accessibility::XAccessible > virtual css::uno::Reference< css::accessibility::XAccessible >
@@ -387,9 +387,9 @@ Reference< XAccessible > AccessibleFactory::createAccessibleTabBar( TabBar& _rTa
} }
Reference< XAccessibleContext > AccessibleFactory::createAccessibleTextWindowContext( Reference< XAccessibleContext > AccessibleFactory::createAccessibleTextWindowContext(
VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView ) const vcl::Window* pWindow, TextEngine& rEngine, TextView& rView) const
{ {
return new Document( pVclXWindow, rEngine, rView ); return new Document(pWindow, rEngine, rView );
} }
Reference< XAccessible > AccessibleFactory::createAccessibleTreeListBox( Reference< XAccessible > AccessibleFactory::createAccessibleTreeListBox(

View File

@@ -57,7 +57,7 @@ TextWindowPeer::TextWindowPeer(TextView & view):
css::uno::Reference<css::accessibility::XAccessibleContext> css::uno::Reference<css::accessibility::XAccessibleContext>
TextWindowPeer::CreateAccessibleContext() { TextWindowPeer::CreateAccessibleContext() {
return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext( return m_aFactoryAccess.getFactory().createAccessibleTextWindowContext(
this, m_rEngine, m_rView); GetWindow(), m_rEngine, m_rView);
} }
} }

View File

@@ -41,6 +41,7 @@ namespace com::sun::star {
namespace vcl { class IAccessibleBrowseBox; } namespace vcl { class IAccessibleBrowseBox; }
namespace vcl { class IAccessibleTabListBox; } namespace vcl { class IAccessibleTabListBox; }
namespace vcl { class IAccessibleTableProvider; } namespace vcl { class IAccessibleTableProvider; }
namespace vcl { class Window; }
class SvHeaderTabListBox; class SvHeaderTabListBox;
class SvtIconChoiceCtrl; class SvtIconChoiceCtrl;
@@ -112,7 +113,7 @@ namespace vcl
virtual css::uno::Reference< css::accessibility::XAccessibleContext > virtual css::uno::Reference< css::accessibility::XAccessibleContext >
createAccessibleTextWindowContext( createAccessibleTextWindowContext(
VCLXWindow* pVclXWindow, TextEngine& rEngine, TextView& rView vcl::Window* pWindow, TextEngine& rEngine, TextView& rView
) const = 0; ) const = 0;
virtual css::uno::Reference< css::accessibility::XAccessible > virtual css::uno::Reference< css::accessibility::XAccessible >