include/svx/ChildrenManager.hxx | 9 ++----- svx/source/accessibility/AccessibleShape.cxx | 8 +++---- svx/source/accessibility/ChildrenManager.cxx | 6 ++--- svx/source/accessibility/ChildrenManagerImpl.cxx | 26 ++++++++--------------- svx/source/accessibility/ChildrenManagerImpl.hxx | 17 +++++++-------- 5 files changed, 28 insertions(+), 38 deletions(-)
New commits: commit 89ef1df9d16cf674115007b11001f1bc972e9c98 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:52:11 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:56 2025 +0200 a11y: Return OAccessible in ChildrenManager::GetChild Change-Id: I3902d46113bf2c961c4444f5812bfb9ee987a4bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189628 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx index 79d00b9a22e9..aaa447b93d63 100644 --- a/include/svx/ChildrenManager.hxx +++ b/include/svx/ChildrenManager.hxx @@ -29,10 +29,6 @@ namespace com::sun::star { -namespace accessibility -{ -class XAccessible; -} namespace drawing { class XShape; @@ -134,7 +130,7 @@ public: @throws Throws an IndexOutOfBoundsException if the index is not valid. */ - css::uno::Reference<css::accessibility::XAccessible> GetChild(sal_Int64 nIndex); + rtl::Reference<comphelper::OAccessible> GetChild(sal_Int64 nIndex); /// @throws css::lang::IndexOutOfBoundsException /// @throws css::uno::RuntimeException const css::uno::Reference<css::drawing::XShape>& GetChildShape(sal_Int64 nIndex); diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 8bffd33c8ead..53da36fa2eae 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -326,28 +326,28 @@ uno::Reference<XAccessible> SAL_CALL { ensureAlive(); - uno::Reference<XAccessible> xChild; + rtl::Reference<comphelper::OAccessible> pChild; // Depending on the index decide whether to delegate this call to the // children manager or the edit engine. if ((mpChildrenManager != nullptr) && (nIndex < mpChildrenManager->GetChildCount())) { - xChild = mpChildrenManager->GetChild (nIndex); + pChild = mpChildrenManager->GetChild(nIndex); } else if (mpText != nullptr) { sal_Int64 nI = nIndex; if (mpChildrenManager != nullptr) nI -= mpChildrenManager->GetChildCount(); - xChild = mpText->GetChild (nI); + pChild = mpText->GetChild(nI); } else throw lang::IndexOutOfBoundsException ( "shape has no child with index " + OUString::number(nIndex), getXWeak()); - return xChild; + return pChild; } uno::Reference<XAccessibleRelationSet> SAL_CALL diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx index 436723f2b118..44f75024f669 100644 --- a/svx/source/accessibility/ChildrenManager.cxx +++ b/svx/source/accessibility/ChildrenManager.cxx @@ -54,7 +54,7 @@ sal_Int64 ChildrenManager::GetChildCount() const noexcept return mpImpl->GetChildCount(); } -css::uno::Reference<XAccessible> ChildrenManager::GetChild (sal_Int64 nIndex) +rtl::Reference<comphelper::OAccessible> ChildrenManager::GetChild(sal_Int64 nIndex) { return mpImpl->GetChild (nIndex); } commit 78f8072dc862d4fb9030f016e2f7fed56a914fa2 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:48:00 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:49 2025 +0200 a11y: Use OAccessible for ChildrenManagerImpl::mxParent Change-Id: I7fe9a7d37af69c390d43f65d33071f09a810dd81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189627 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx index 23a877c25f60..79d00b9a22e9 100644 --- a/include/svx/ChildrenManager.hxx +++ b/include/svx/ChildrenManager.hxx @@ -23,6 +23,7 @@ #include <sal/config.h> #include <com/sun/star/uno/Reference.hxx> +#include <comphelper/OAccessible.hxx> #include <rtl/ref.hxx> #include <svx/svxdllapi.h> @@ -105,7 +106,7 @@ public: for new and deleted children, i.e. that holds a list of listeners to be informed. */ - ChildrenManager(const css::uno::Reference<css::accessibility::XAccessible>& rxParent, + ChildrenManager(const rtl::Reference<comphelper::OAccessible>& rpParent, const css::uno::Reference<css::drawing::XShapes>& rxShapeList, const AccessibleShapeTreeInfo& rShapeTreeInfo, AccessibleContextBase& rContext); diff --git a/svx/source/accessibility/ChildrenManager.cxx b/svx/source/accessibility/ChildrenManager.cxx index 2cac5153a5a4..436723f2b118 100644 --- a/svx/source/accessibility/ChildrenManager.cxx +++ b/svx/source/accessibility/ChildrenManager.cxx @@ -29,13 +29,13 @@ namespace accessibility { // AccessibleChildrenManager ChildrenManager::ChildrenManager ( - const css::uno::Reference<XAccessible>& rxParent, + const rtl::Reference<comphelper::OAccessible>& rpParent, const css::uno::Reference<drawing::XShapes>& rxShapeList, const AccessibleShapeTreeInfo& rShapeTreeInfo, AccessibleContextBase& rContext) : mpImpl( new ChildrenManagerImpl( - rxParent, rxShapeList, rShapeTreeInfo, rContext)) + rpParent, rxShapeList, rShapeTreeInfo, rContext)) { mpImpl->Init (); } diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index df1b906a67fa..6a5e84887cb3 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -67,12 +67,12 @@ void adjustIndexInParentOfShapes(ChildDescriptorListType& _rList) // AccessibleChildrenManager ChildrenManagerImpl::ChildrenManagerImpl ( - uno::Reference<XAccessible> xParent, + rtl::Reference<comphelper::OAccessible> pParent, uno::Reference<drawing::XShapes> xShapeList, const AccessibleShapeTreeInfo& rShapeTreeInfo, AccessibleContextBase& rContext) : mxShapeList (std::move(xShapeList)), - mxParent (std::move(xParent)), + mpParent(std::move(pParent)), maShapeTreeInfo (rShapeTreeInfo), mrContext (rContext), mpFocusedShape(nullptr) @@ -118,9 +118,8 @@ const css::uno::Reference<css::drawing::XShape>& ChildrenManagerImpl::GetChildSh { // Check whether the given index is valid. if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size()) - throw lang::IndexOutOfBoundsException ( - "no accessible child with index " + OUString::number(nIndex), - mxParent); + throw lang::IndexOutOfBoundsException("no accessible child with index " + + OUString::number(nIndex)); return maVisibleChildren[nIndex].mxShape; } @@ -131,9 +130,8 @@ rtl::Reference<comphelper::OAccessible> ChildrenManagerImpl::GetChild(sal_Int64 { // Check whether the given index is valid. if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size()) - throw lang::IndexOutOfBoundsException ( - "no accessible child with index " + OUString::number(nIndex), - mxParent); + throw lang::IndexOutOfBoundsException("no accessible child with index " + + OUString::number(nIndex)); return GetChild (maVisibleChildren[nIndex],nIndex); } @@ -152,10 +150,7 @@ ChildrenManagerImpl::GetChild(ChildDescriptor& rChildDescriptor, sal_Int32 _nInd // created while locking the global mutex. if ( ! rChildDescriptor.mxAccessibleShape.is()) { - AccessibleShapeInfo aShapeInfo( - rChildDescriptor.mxShape, - mxParent, - this); + AccessibleShapeInfo aShapeInfo(rChildDescriptor.mxShape, mpParent, this); // Create accessible object that corresponds to the descriptor's // shape. rtl::Reference<AccessibleShape> pShape( diff --git a/svx/source/accessibility/ChildrenManagerImpl.hxx b/svx/source/accessibility/ChildrenManagerImpl.hxx index 1ada09bf257e..ecf79aac0a4f 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.hxx +++ b/svx/source/accessibility/ChildrenManagerImpl.hxx @@ -95,10 +95,10 @@ public: for new and deleted children, i.e. that holds a list of listeners to be informed. */ - ChildrenManagerImpl (css::uno::Reference<css::accessibility::XAccessible> xParent, - css::uno::Reference<css::drawing::XShapes> xShapeList, - const AccessibleShapeTreeInfo& rShapeTreeInfo, - AccessibleContextBase& rContext); + ChildrenManagerImpl(rtl::Reference<comphelper::OAccessible> pParent, + css::uno::Reference<css::drawing::XShapes> xShapeList, + const AccessibleShapeTreeInfo& rShapeTreeInfo, + AccessibleContextBase& rContext); /** If there still are managed children these are disposed and released. @@ -299,7 +299,7 @@ private: /** The parent of the shapes. It is used for creating accessible objects for given shapes. */ - css::uno::Reference<css::accessibility::XAccessible> mxParent; + rtl::Reference<comphelper::OAccessible> mpParent; /** Bundle of information passed down the shape tree. */ commit 7f299f4b8c97365b6007162255e8503c384acf9b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:40:27 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:42 2025 +0200 svx a11y: Return OAccessible in ChildrenManagerImpl::GetChild Change-Id: I8fb63ef0a0281ed6e95160142414bb7946fb20ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189626 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 2137b309d03b..df1b906a67fa 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -127,8 +127,7 @@ const css::uno::Reference<css::drawing::XShape>& ChildrenManagerImpl::GetChildSh /** Return the requested accessible child object. Create it if it is not yet in the cache. */ -uno::Reference<XAccessible> - ChildrenManagerImpl::GetChild (sal_Int64 nIndex) +rtl::Reference<comphelper::OAccessible> ChildrenManagerImpl::GetChild(sal_Int64 nIndex) { // Check whether the given index is valid. if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size()) @@ -143,8 +142,8 @@ uno::Reference<XAccessible> /** Return the requested accessible child object. Create it if it is not yet in the cache. */ -uno::Reference<XAccessible> - ChildrenManagerImpl::GetChild (ChildDescriptor& rChildDescriptor,sal_Int32 _nIndex) +rtl::Reference<comphelper::OAccessible> +ChildrenManagerImpl::GetChild(ChildDescriptor& rChildDescriptor, sal_Int32 _nIndex) { if ( ! rChildDescriptor.mxAccessibleShape.is()) { diff --git a/svx/source/accessibility/ChildrenManagerImpl.hxx b/svx/source/accessibility/ChildrenManagerImpl.hxx index fe4d21b6c5eb..1ada09bf257e 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.hxx +++ b/svx/source/accessibility/ChildrenManagerImpl.hxx @@ -132,8 +132,7 @@ public: @throws Throws an IndexOutOfBoundsException if the index is not valid. */ - css::uno::Reference<css::accessibility::XAccessible> - GetChild (sal_Int64 nIndex); + rtl::Reference<comphelper::OAccessible> GetChild(sal_Int64 nIndex); /** Return the requested accessible child. @param aChildDescriptor @@ -147,8 +146,8 @@ public: accessible object of the corresponding shape. @throws css::uno::RuntimeException */ - css::uno::Reference<css::accessibility::XAccessible> - GetChild (ChildDescriptor& aChildDescriptor,sal_Int32 _nIndex); + rtl::Reference<comphelper::OAccessible> GetChild(ChildDescriptor& aChildDescriptor, + sal_Int32 _nIndex); /** Update the child manager. Take care of a modified set of children and modified visible area. This method can optimize the update