From 941ab8acf0765131fb9d0af560846293f3768d13 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 11 Jan 2023 11:39:35 +0100 Subject: comphelper::OCommonAccessibleComponent's XAggregation is apparently unused It had been using WeakAggComponentImplHelper2 ever since 2f79d5f4794ec7f076bb290702b4c9c0afb2a6c8 "initial checkin - helper for implementing an XAccessibleContext", but all the classes that derive from it (comphelper::OAccessibleComponentHelper, comphelper::OAccessibleExtendedComponentHelper, and classes that in turn derive from those) implement queryInterface (in a way not just forwarding to the base class queryInterface, as would be required for classes implementing XAggregation) rather than queryAggregation, so aggregation was broken and any delegator would be ignored when calling queryInterface on one of the derived classes. Also, without this commit but instead with a local > --- a/include/comphelper/accessiblecomponenthelper.hxx > +++ b/include/comphelper/accessiblecomponenthelper.hxx > @@ -49,6 +49,7 @@ namespace comphelper > :public ::cppu::BaseMutex > ,public OCommonAccessibleComponent_Base > { > + void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } > friend class OContextEntryGuard; > private: > css::uno::WeakReference< css::accessibility::XAccessible > m_aCreator; // the XAccessible which created our XAccessibleContext on all of Linux, macOS, and Windows: `make check` still succeeded, and running the resulting LibreOffice with the system in some assistive technology narration mode produced audio, all without hitting that injected assert that should have fired if the XAggregation mechanism had been used after all. Change-Id: I47045824d0762a5f3de150a11576694621b163b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145330 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/comphelper/accessiblecomponenthelper.hxx | 8 ++++---- svx/source/inc/charmapacc.hxx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/comphelper/accessiblecomponenthelper.hxx b/include/comphelper/accessiblecomponenthelper.hxx index 0c738d0e6df0..8743b322a4d8 100644 --- a/include/comphelper/accessiblecomponenthelper.hxx +++ b/include/comphelper/accessiblecomponenthelper.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -38,9 +38,9 @@ namespace comphelper //= OCommonAccessibleComponent - typedef ::cppu::WeakAggComponentImplHelper2 < css::accessibility::XAccessibleContext2, - css::accessibility::XAccessibleEventBroadcaster - > OCommonAccessibleComponent_Base; + typedef ::cppu::WeakComponentImplHelper < css::accessibility::XAccessibleContext2, + css::accessibility::XAccessibleEventBroadcaster + > OCommonAccessibleComponent_Base; /** base class encapsulating common functionality for the helper classes implementing the XAccessibleComponent respectively XAccessibleExtendendComponent diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx index 3831c3485ccf..201f53db3f37 100644 --- a/svx/source/inc/charmapacc.hxx +++ b/svx/source/inc/charmapacc.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include -- cgit