include/svx/AccessibleShape.hxx              |   28 +++------------
 svx/source/accessibility/AccessibleShape.cxx |   48 +++------------------------
 2 files changed, 13 insertions(+), 63 deletions(-)

New commits:
commit cc04e8b1774702761f89201cefa94fc961c5c68f
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Jan 12 20:34:40 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Jan 13 19:39:07 2026 +0100

    svx a11y: Use ImplInheritanceHelper for AccessibleShape
    
    This drops the need to manually implement/override
    the XInterface methods.
    
    AccessibleShape::getTypes doesn't simply return the types
    of the implemented UNO interfaces, so leave the custom
    implementation in place for now.
    (The reason for this custom handling isn't immediately
    clear to me at first glance.)
    
    Change-Id: I544ad8a2b9594dd6c0fb75ae489e1cb98d5cd4f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197144
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/svx/AccessibleShape.hxx b/include/svx/AccessibleShape.hxx
index dabe921ae7e9..94f7dc2aefd5 100644
--- a/include/svx/AccessibleShape.hxx
+++ b/include/svx/AccessibleShape.hxx
@@ -79,14 +79,12 @@ class IAccessibleParent;
     container, who can then call dispose() at the accessible object.</p>
 */
 class SVX_DLLPUBLIC AccessibleShape
-    :   public AccessibleContextBase,
-        public css::accessibility::XAccessibleSelection,
-        public css::accessibility::XAccessibleExtendedAttributes,
-        public css::accessibility::XAccessibleGroupPosition,
-        public css::accessibility::XAccessibleHypertext,
-        public IAccessibleViewForwarderListener,
-        public css::document::XShapeEventListener,
-        public css::lang::XUnoTunnel
+    : public cppu::ImplInheritanceHelper<
+          AccessibleContextBase, css::accessibility::XAccessibleSelection,
+          css::accessibility::XAccessibleExtendedAttributes,
+          css::accessibility::XAccessibleGroupPosition, 
css::accessibility::XAccessibleHypertext,
+          css::document::XShapeEventListener, css::lang::XUnoTunnel>,
+      public IAccessibleViewForwarderListener
 {
 public:
     /** Create a new accessible object that makes the given shape accessible.
@@ -257,20 +255,6 @@ public:
             const css::uno::Reference<
             css::accessibility::XAccessibleEventListener >& rxListener) 
override;
 
-
-    //=====  XInterface  ======================================================
-
-    virtual css::uno::Any SAL_CALL
-        queryInterface (const css::uno::Type & rType) override;
-
-    virtual void SAL_CALL
-        acquire()
-        noexcept override;
-
-    virtual void SAL_CALL
-        release()
-        noexcept override;
-
     //=====  XTypeProvider  ===================================================
 
     virtual css::uno::Sequence< css::uno::Type> SAL_CALL
diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index 87e345158913..7c6300c2903e 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -93,14 +93,13 @@ OUString GetOptionalProperty (
 } // end of anonymous namespace
 
 // internal
-AccessibleShape::AccessibleShape (
-    const AccessibleShapeInfo& rShapeInfo,
-    const AccessibleShapeTreeInfo& rShapeTreeInfo)
-    : AccessibleContextBase (rShapeInfo.mxParent,AccessibleRole::SHAPE),
-      mxShape (rShapeInfo.mxShape),
-      maShapeTreeInfo (rShapeTreeInfo),
-      m_nIndexInParent(-1),
-      mpParent (rShapeInfo.mpChildrenManager)
+AccessibleShape::AccessibleShape(const AccessibleShapeInfo& rShapeInfo,
+                                 const AccessibleShapeTreeInfo& rShapeTreeInfo)
+    : ImplInheritanceHelper(rShapeInfo.mxParent, AccessibleRole::SHAPE)
+    , mxShape(rShapeInfo.mxShape)
+    , maShapeTreeInfo(rShapeTreeInfo)
+    , m_nIndexInParent(-1)
+    , mpParent(rShapeInfo.mpChildrenManager)
 {
     m_pShape = SdrObject::getSdrObjectFromXShape(mxShape);
     UpdateNameAndDescription();
@@ -652,39 +651,6 @@ void SAL_CALL 
AccessibleShape::removeAccessibleEventListener (
         mpText->RemoveEventListener (rxListener);
 }
 
-// XInterface
-css::uno::Any SAL_CALL
-    AccessibleShape::queryInterface (const css::uno::Type & rType)
-{
-    css::uno::Any aReturn = AccessibleContextBase::queryInterface (rType);
-    if ( ! aReturn.hasValue())
-        aReturn = ::cppu::queryInterface (rType,
-            static_cast< css::accessibility::XAccessibleSelection* >(this),
-            static_cast< css::accessibility::XAccessibleExtendedAttributes* 
>(this),
-            static_cast<document::XShapeEventListener*>(this),
-            static_cast<lang::XUnoTunnel*>(this),
-            static_cast<XAccessibleGroupPosition*>(this),
-            static_cast<XAccessibleHypertext*>(this)
-            );
-    return aReturn;
-}
-
-
-void SAL_CALL
-    AccessibleShape::acquire()
-    noexcept
-{
-    AccessibleContextBase::acquire ();
-}
-
-
-void SAL_CALL
-    AccessibleShape::release()
-    noexcept
-{
-    AccessibleContextBase::release ();
-}
-
 // XAccessibleSelection
 void SAL_CALL AccessibleShape::selectAccessibleChild( sal_Int64 )
 {

Reply via email to