diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-01 10:30:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-23 14:19:32 +0000 |
commit | c0c4519e0d5b555f59bbc04cc616454edfd1f4ce (patch) | |
tree | 9cecccbb909c34a1aacf7a542682c248266f503e /toolkit | |
parent | 1b6acdc60bc284c3e78bb05f70c24a2e36b2ccc7 (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 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxaccessiblecomponent.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx b/toolkit/source/awt/vclxaccessiblecomponent.cxx index 7fbb1ea1ccd6..6d0798bda590 100644 --- a/toolkit/source/awt/vclxaccessiblecomponent.cxx +++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRelationType.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> #include <toolkit/awt/vclxaccessiblecomponent.hxx> @@ -105,6 +106,15 @@ uno::Sequence< OUString > VCLXAccessibleComponent::getSupportedServiceNames() return aNames; } +sal_Int64 VCLXAccessibleComponent::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) { + return comphelper::getSomethingImpl(aIdentifier, this); +} + +css::uno::Sequence<sal_Int8> const & VCLXAccessibleComponent::getUnoTunnelId() { + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclWindowEvent&, rEvent, void ) { /* Ignore VclEventId::WindowEndPopupMode, because the UNO accessibility wrapper @@ -169,7 +179,7 @@ void VCLXAccessibleComponent::ProcessWindowChildEvent( const VclWindowEvent& rVc uno::Reference<XAccessibleContext> xChildContext = xAcc->getAccessibleContext(); if (xChildContext.is()) { - VCLXAccessibleComponent* pChildComponent = dynamic_cast<VCLXAccessibleComponent*>(xChildContext.get()); + VCLXAccessibleComponent* pChildComponent = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(xChildContext); if (pChildComponent) { css::uno::Any aNewStateValue; @@ -190,7 +200,7 @@ void VCLXAccessibleComponent::ProcessWindowChildEvent( const VclWindowEvent& rVc uno::Reference<XAccessibleContext> xChildContext = xAcc->getAccessibleContext(); if (xChildContext.is()) { - VCLXAccessibleComponent* pChildComponent = dynamic_cast<VCLXAccessibleComponent*>(xChildContext.get()); + VCLXAccessibleComponent* pChildComponent = comphelper::getFromUnoTunnel<VCLXAccessibleComponent>(xChildContext); if (pChildComponent) { css::uno::Any aOldStateValue; |