winaccessibility/source/service/AccTopWindowListener.cxx | 16 +++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
New commits: commit 434e9f28dc3c0560c7234622f0e064c18e25517a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu May 22 10:01:43 2025 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu May 22 13:45:54 2025 +0200 wina11y: Use VCLUnoHelper::GetWindow Change-Id: I6e28b98f4cbd3601a746d53a4962aa7cf3c633e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185646 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx index cf27e30cb10a..4051e099ee4c 100644 --- a/winaccessibility/source/service/AccTopWindowListener.cxx +++ b/winaccessibility/source/service/AccTopWindowListener.cxx @@ -19,9 +19,8 @@ #include <sal/log.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/window.hxx> -#include <toolkit/awt/vclxwindow.hxx> - #include <vcl/accessibility/vclxaccessiblecomponent.hxx> #include <vcl/sysdata.hxx> #include <vcl/svapp.hxx> @@ -30,6 +29,7 @@ #include <unomsaaevent.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/awt/XWindow.hpp> using namespace com::sun::star::uno; @@ -100,10 +100,8 @@ void AccTopWindowListener::windowOpened( const css::lang::EventObject& e ) SolarMutexGuard g; - VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>(e.Source.get()); - assert(pVCLXWindow && "Window is not a VCLXWindow"); - - vcl::Window* pWindow = pVCLXWindow->GetWindow(); + css::uno::Reference<css::awt::XWindow> xWindow(e.Source, UNO_QUERY_THROW); + vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWindow); assert(pWindow); HandleWindowOpened(pWindow); @@ -171,10 +169,8 @@ void AccTopWindowListener::windowClosed( const css::lang::EventObject& e ) if ( !e.Source.is()) return; - VCLXWindow* pVCLXWindow = dynamic_cast<VCLXWindow*>(e.Source.get()); - assert(pVCLXWindow && "Window is not a VCLXWindow"); - - vcl::Window* pWindow = pVCLXWindow->GetWindow(); + css::uno::Reference<css::awt::XWindow> xWindow(e.Source, UNO_QUERY_THROW); + vcl::Window* pWindow = VCLUnoHelper::GetWindow(xWindow); assert(pWindow); Reference<css::accessibility::XAccessible> xAccessible = pWindow->GetAccessible();