winaccessibility/source/service/msaaservice_impl.cxx |   21 ++-----------------
 1 file changed, 3 insertions(+), 18 deletions(-)

New commits:
commit 9b2789b9cbe662f3df9204b3d6f7e1d6cc9a84c3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 16:46:58 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 31 06:17:00 2025 +0200

    wina11y: Simplify AccessBridgeUpdateOldTopWindows
    
    Use an OAccessible var instead of an XAccessible one, which
    drops the need to query for the XAccessibleConetxt interface.
    
    Change-Id: I331890f6d2b1d507ad72108a10538fabb1372cfb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188606
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/winaccessibility/source/service/msaaservice_impl.cxx 
b/winaccessibility/source/service/msaaservice_impl.cxx
index e142a2710cf5..b6247737b75f 100644
--- a/winaccessibility/source/service/msaaservice_impl.cxx
+++ b/winaccessibility/source/service/msaaservice_impl.cxx
@@ -149,16 +149,9 @@ static void AccessBridgeUpdateOldTopWindows( const 
Reference< XMSAAService > &xA
     for (tools::Long i = 0; i < nTopWindowCount; i++)
     {
         vcl::Window* pTopWindow = Application::GetTopWindow( i );
-        css::uno::Reference< css::accessibility::XAccessible > xAccessible = 
pTopWindow->GetAccessible();
-        if ( xAccessible.is() )
-        {
-            css::uno::Reference< css::accessibility::XAccessibleContext > xAC( 
xAccessible->getAccessibleContext() );
-            if ( xAC.is())
-            {
-                if ( !xAC->getAccessibleName().isEmpty() )
-                    
xAccMgr->handleWindowOpened(reinterpret_cast<sal_Int64>(pTopWindow));
-            }
-        }
+        rtl::Reference<comphelper::OAccessible> pAccessible = 
pTopWindow->GetAccessible();
+        if (pAccessible.is() && !pAccessible->getAccessibleName().isEmpty())
+            
xAccMgr->handleWindowOpened(reinterpret_cast<sal_Int64>(pTopWindow));
     }
 }
 
commit 23a9ac92e65abcdfee049897fa13db9c5ee646cb
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 16:43:00 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Jul 31 06:16:53 2025 +0200

    wina11y: Inline AccessBridgeHandleExistingWindow into only caller
    
    Change-Id: I9975cae886e2950a03efde4dec4a747936a65706
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188605
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/winaccessibility/source/service/msaaservice_impl.cxx 
b/winaccessibility/source/service/msaaservice_impl.cxx
index fe91e1f60166..e142a2710cf5 100644
--- a/winaccessibility/source/service/msaaservice_impl.cxx
+++ b/winaccessibility/source/service/msaaservice_impl.cxx
@@ -140,14 +140,6 @@ Sequence< OUString > 
MSAAServiceImpl::getSupportedServiceNames()
    return { "com.sun.star.accessibility.MSAAService" };
 }
 
-static void AccessBridgeHandleExistingWindow(const Reference< XMSAAService>& 
xAccMgr,
-                                             vcl::Window* pWindow)
-{
-    assert(xAccMgr.is());
-    assert(pWindow);
-    xAccMgr->handleWindowOpened(reinterpret_cast<sal_Int64>(pWindow));
-}
-
 /*
  * Setup and notify the OS of Accessible peers for all existing windows.
  */
@@ -164,7 +156,7 @@ static void AccessBridgeUpdateOldTopWindows( const 
Reference< XMSAAService > &xA
             if ( xAC.is())
             {
                 if ( !xAC->getAccessibleName().isEmpty() )
-                    AccessBridgeHandleExistingWindow(xAccMgr, pTopWindow);
+                    
xAccMgr->handleWindowOpened(reinterpret_cast<sal_Int64>(pTopWindow));
             }
         }
     }

Reply via email to