summaryrefslogtreecommitdiff
path: root/winaccessibility
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-01 10:30:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-23 14:19:32 +0000
commitc0c4519e0d5b555f59bbc04cc616454edfd1f4ce (patch)
tree9cecccbb909c34a1aacf7a542682c248266f503e /winaccessibility
parent1b6acdc60bc284c3e78bb05f70c24a2e36b2ccc7 (diff)
loplugin:unocast (VCLXAccessibleComponent)
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I11496cc1d37e89ce8f11991f86c7b60bb1b93106 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144748 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'winaccessibility')
-rw-r--r--winaccessibility/source/service/AccTopWindowListener.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/winaccessibility/source/service/AccTopWindowListener.cxx b/winaccessibility/source/service/AccTopWindowListener.cxx
index a6b935d55798..70c2429f71e2 100644
--- a/winaccessibility/source/service/AccTopWindowListener.cxx
+++ b/winaccessibility/source/service/AccTopWindowListener.cxx
@@ -18,6 +18,7 @@
*/
+#include <comphelper/servicehelper.hxx>
#include <sal/log.hxx>
#include <vcl/window.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
@@ -44,7 +45,8 @@ void AccTopWindowListener::HandleWindowOpened( css::accessibility::XAccessible*
VclPtr<vcl::Window> window;
if (auto pvclwindow = dynamic_cast<VCLXWindow*>(pAccessible))
window = pvclwindow->GetWindow();
- else if (auto pvclxcomponent = dynamic_cast<VCLXAccessibleComponent*>(pAccessible))
+ else if (auto pvclxcomponent
+ = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(pAccessible))
window = pvclxcomponent->GetWindow();
assert(window);
// The SalFrame of window may be destructed at this time