include/vcl/svapp.hxx       |    2 --
 vcl/inc/svdata.hxx          |    4 ----
 vcl/source/app/svapp.cxx    |    7 -------
 vcl/source/app/svdata.cxx   |   23 -----------------------
 vcl/win/window/salframe.cxx |   15 ++++++++++++++-
 5 files changed, 14 insertions(+), 37 deletions(-)

New commits:
commit b4a26ca791fd802a038f5a764517d515c01f05d9
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Oct 29 16:12:00 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Oct 30 08:27:36 2024 +0100

    win a11y: Move (Impl)InitAccessBridge logic to only caller
    
    Now, with previous commit
    
        Change-Id: I42f0059cecd43205690d958a875d3c17ff9a197b
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Tue Oct 29 15:08:37 2024 +0100
    
            win a11y: Stop using setting to indicate AT support
    
    in place, InitAccessBridge only gets called from the Windows-
    specific ImplHandleGetObject. Therefore, move the logic
    from ImplInitAccessBridge there and drop the InitAccessBridge
    and ImplInitAccessBridge functions.
    
    Change-Id: Id0d08478b84434b4ec03ab72b8af40e8ad51bd71
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175796
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index c22daf19fcc2..ea1c3838aa33 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1434,8 +1434,6 @@ VCL_DLLPUBLIC bool IsVCLInit();
 VCL_DLLPUBLIC bool InitVCL();
 VCL_DLLPUBLIC void DeInitVCL();
 
-VCL_DLLPUBLIC void InitAccessBridge();
-
 // only allowed to call, if no thread is running. You must call 
JoinMainLoopThread to free all memory.
 VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * 
pThreadData );
 VCL_DLLPUBLIC void JoinMainLoopThread();
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index f3c2f43a369f..a839b4276959 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -461,10 +461,6 @@ VCL_DLLPUBLIC bool        ImplCallPreNotify( NotifyEvent& 
rEvt );
 VCL_PLUGIN_PUBLIC ImplSVData* ImplGetSVData();
 VCL_PLUGIN_PUBLIC void ImplHideSplash();
 
-#ifdef _WIN32
-void ImplInitAccessBridge();
-#endif
-
 const FieldUnitStringList& ImplGetFieldUnits();
 const FieldUnitStringList& ImplGetCleanedFieldUnits();
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 819fdaf729d7..527bcde60c99 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1634,13 +1634,6 @@ void Application::AddToRecentDocumentList(const 
OUString& rFileUrl, const OUStri
     pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType, 
rDocumentService);
 }
 
-void InitAccessBridge()
-{
-#ifdef _WIN32
-    ImplInitAccessBridge();
-#endif
-}
-
 // MT: AppEvent was in oldsv.cxx, but is still needed...
 void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ )
 {
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 6f0732ef498c..6437b871f41a 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -50,8 +50,6 @@
 #include <units.hrc>
 #include <print.h>
 
-#include <com/sun/star/accessibility/MSAAService.hpp>
-
 #include <config_features.h>
 #include <basegfx/utils/systemdependentdata.hxx>
 #include <mutex>
@@ -329,27 +327,6 @@ BlendFrameCache* ImplGetBlendFrameCache()
     return pSVData->mpBlendFrameCache.get();
 }
 
-#ifdef _WIN32
-void ImplInitAccessBridge()
-{
-    ImplSVData* pSVData = ImplGetSVData();
-    if( ! pSVData->mxAccessBridge.is() )
-    {
-        css::uno::Reference< XComponentContext > 
xContext(comphelper::getProcessComponentContext());
-        try
-        {
-            pSVData->mxAccessBridge = 
css::accessibility::MSAAService::create(xContext);
-            SAL_INFO("vcl", "got IAccessible2 bridge");
-        }
-        catch (css::uno::DeploymentException &)
-        {
-            TOOLS_WARN_EXCEPTION("vcl", "got no IAccessible2 bridge");
-            assert(false && "failed to create IAccessible2 bridge");
-        }
-    }
-}
-#endif
-
 void LocaleConfigurationListener::ConfigurationChanged( 
utl::ConfigurationBroadcaster*, ConfigurationHints nHint )
 {
     AllSettings::LocaleSettingsChanged( nHint );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index f6ca2eaf6d74..09018fdf8c6b 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -17,10 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <com/sun/star/accessibility/MSAAService.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/uno/DeploymentException.hpp>
 
 #include <officecfg/Office/Common.hxx>
 
@@ -30,6 +32,7 @@
 
 #include <svsys.h>
 
+#include <comphelper/diagnose_ex.hxx>
 #include <comphelper/windowserrorstring.hxx>
 
 #include <rtl/bootstrap.hxx>
@@ -5618,7 +5621,17 @@ ImplHandleGetObject(HWND hWnd, LPARAM lParam, WPARAM 
wParam, LRESULT & nRet)
         // to avoid RFT interrupts regular accessibility processing
         if ( !pSVData->mxAccessBridge.is() )
         {
-            InitAccessBridge();
+            css::uno::Reference<XComponentContext> 
xContext(comphelper::getProcessComponentContext());
+            try
+            {
+                pSVData->mxAccessBridge = 
css::accessibility::MSAAService::create(xContext);
+                SAL_INFO("vcl", "got IAccessible2 bridge");
+            }
+            catch (css::uno::DeploymentException&)
+            {
+                TOOLS_WARN_EXCEPTION("vcl", "got no IAccessible2 bridge");
+                assert(false && "failed to create IAccessible2 bridge");
+            }
         }
         xMSAA.set(pSVData->mxAccessBridge, uno::UNO_QUERY);
         ImplSalYieldMutexRelease();

Reply via email to