winaccessibility/source/service/AccFrameEventListener.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ed03c63f00dee22112a8632df45e5e044541960d
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu May 22 09:45:02 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu May 22 13:45:34 2025 +0200

    wina11y: Don't rely on win accessible being VCLXWindow
    
    While at the moment, the XAccessible for many vcl::Window
    subclasses is a VCLXWindow, this is an implementation
    detail that is subject to change.
    Switch away from relying on that implementation detail,
    and instead rely on the XAccessibleContext being a
    VCLXAccessibleComponent, which will remain true even
    if that one will be created without VCLXWindow being
    involved in the future.
    
    See also
    
            commit b1f3e41f1015f0166dca1382c5fa1d1223f72fb8
            Author: Michael Weghorn <m.wegh...@posteo.de>
            Date:   Wed May 21 11:03:56 2025 +0200
    
                sw a11y test: Don't rely on XWindow being XAccessible
    
    for more background (which ports away from an assumption
    "the other way around").
    
    Change-Id: Ia2e2fe9d88c05afcde2c8a6d31c20c60cfbd5c49
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185645
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/source/service/AccFrameEventListener.cxx 
b/winaccessibility/source/service/AccFrameEventListener.cxx
index 5e5a7c2159a9..322eb3bc0382 100644
--- a/winaccessibility/source/service/AccFrameEventListener.cxx
+++ b/winaccessibility/source/service/AccFrameEventListener.cxx
@@ -28,8 +28,8 @@
 #include <AccObjectWinManager.hxx>
 #include <unomsaaevent.hxx>
 
+#include <vcl/accessibility/vclxaccessiblecomponent.hxx>
 #include <vcl/window.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
 #include <vcl/sysdata.hxx>
 
 using namespace com::sun::star::uno;
@@ -78,10 +78,10 @@ void AccFrameEventListener::HandleChildChangedEvent(Any 
oldValue, Any newValue)
     {
         if(xChild.is())
         {
-            VCLXWindow* pvclwindow = 
dynamic_cast<VCLXWindow*>(m_xAccessible.get());
-            assert(pvclwindow);
-            const SystemEnvData* systemdata
-                = pvclwindow->GetWindow()->GetSystemData();
+            VCLXAccessibleComponent* pVCLAccComponent = 
dynamic_cast<VCLXAccessibleComponent*>(
+                m_xAccessible->getAccessibleContext().get());
+            assert(pVCLAccComponent);
+            const SystemEnvData* systemdata = 
pVCLAccComponent->GetWindow()->GetSystemData();
 
             m_rObjManager.InsertAccObj(xChild.get(), m_xAccessible.get(), 
systemdata->hWnd);
             m_rObjManager.InsertChildrenAccObj(xChild.get());

Reply via email to