summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-01-11 11:39:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-01-12 08:12:44 +0000
commit941ab8acf0765131fb9d0af560846293f3768d13 (patch)
tree3a3b64437a6c8dd32f4886a531f3aca549967b56
parent200e2a3c28bdeec785ac389473f5fca6576071a0 (diff)
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<css::uno::XInterface> 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 <sbergman@redhat.com>
-rw-r--r--include/comphelper/accessiblecomponenthelper.hxx8
-rw-r--r--svx/source/inc/charmapacc.hxx1
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 <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp>
#include <comphelper/accessibleeventnotifier.hxx>
#include <cppuhelper/basemutex.hxx>
-#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/compbase.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/comphelperdllapi.h>
@@ -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 <comphelper/accessibleselectionhelper.hxx>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
+#include <cppuhelper/implbase2.hxx>
#include <tools/gen.hxx>
#include <rtl/ref.hxx>