accessibility/inc/extended/accessiblelistbox.hxx |8 +---
accessibility/source/extended/accessiblelistbox.cxx |6 --
include/toolkit/awt/vclxaccessiblecomponent.hxx | 10 +++---
toolkit/source/awt/vclxaccessiblecomponent.cxx | 14 --
winaccessibility/source/service/AccTopWindowListener.cxx |4 +++-
5 files changed, 31 insertions(+), 11 deletions(-)
New commits:
commit c0c4519e0d5b555f59bbc04cc616454edfd1f4ce
Author: Stephan Bergmann
AuthorDate: Thu Dec 1 10:30:16 2022 +0100
Commit: Stephan Bergmann
CommitDate: Fri Dec 23 14:19:32 2022 +
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
diff --git a/accessibility/inc/extended/accessiblelistbox.hxx
b/accessibility/inc/extended/accessiblelistbox.hxx
index 339e32f3b0b7..7138820123ad 100644
--- a/accessibility/inc/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/extended/accessiblelistbox.hxx
@@ -35,12 +35,14 @@ namespace accessibility
{
class AccessibleListBoxEntry;
+using AccessibleListBox_Base = cppu::ImplHelper2<
+css::accessibility::XAccessible,
+css::accessibility::XAccessibleSelection>;
+
/** the class OAccessibleListBoxEntry represents the base class for an
accessible object of a listbox entry
*/
class AccessibleListBox :
-public cppu::ImplHelper2<
-css::accessibility::XAccessible,
-css::accessibility::XAccessibleSelection>,
+public AccessibleListBox_Base,
public VCLXAccessibleComponent
{
diff --git a/accessibility/source/extended/accessiblelistbox.cxx
b/accessibility/source/extended/accessiblelistbox.cxx
index df4a9a759c0f..bb1131d0ab4f 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -58,8 +58,10 @@ namespace accessibility
dispose();
}
}
-IMPLEMENT_FORWARD_XINTERFACE2(AccessibleListBox, VCLXAccessibleComponent,
ImplHelper2)
-IMPLEMENT_FORWARD_XTYPEPROVIDER2(AccessibleListBox,
VCLXAccessibleComponent, ImplHelper2)
+IMPLEMENT_FORWARD_XINTERFACE2(
+AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base);
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(
+AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_Base);
void AccessibleListBox::ProcessWindowEvent( const VclWindowEvent&
rVclWindowEvent )
{
diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx
b/include/toolkit/awt/vclxaccessiblecomponent.hxx
index 7c299edf6d65..dd25c76c2c2d 100644
--- a/include/toolkit/awt/vclxaccessiblecomponent.hxx
+++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx
@@ -22,7 +22,8 @@
#include
#include
-#include
+#include
+#include
#include
#include
@@ -42,8 +43,8 @@ class AccessibleRelationSetHelper;
-typedef ::cppu::ImplHelper1<
-css::lang::XServiceInfo > VCLXAccessibleComponent_BASE;
+typedef ::cppu::ImplHelper2<
+css::lang::XServiceInfo, css::lang::XUnoTunnel >
VCLXAccessibleComponent_BASE;
class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent
:public comphelper::OAccessibleExtendedComponentHelper
@@ -89,6 +90,9 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName )
override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
override;
+sal_Int64 SAL_CALL getSomething(css::uno::Sequence const &
aIdentifier) override;
+static css::uno::Sequence const & getUnoTunnelId();
+
// css::accessibility::XAccessibleContext
sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL
getAccessibleChild( sal_Int64 i ) override;
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
#include
#include
+#include
#include
#include
#include
@@ -105,6 +106,15 @@ uno::Sequence< OUString >
VCLXAccessibleComponent::getSupportedServiceNames()
return aNames;
}
+sal_Int64 VCLXAccessibleComponent::getSomething(css::uno::Sequence
const & aIdentifier) {
+return comphelper::getSomethingImpl(aIdentifier, this);
+}
+
+css::uno::Sequence const & VCLXAccessibleComponent::getUnoTunnelId()
{
+static comphelper::UnoIdInit const id;
+return id.getSeq();
+}
+
IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, VclWindowEvent&,
rEvent, void )
{
/* Ignore VclEventId::WindowEndPopupMode,