diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx index 1ae4f67f6dbc..44a9bf076d56 100644 --- a/editeng/source/accessibility/AccessibleContextBase.cxx +++ b/editeng/source/accessibility/AccessibleContextBase.cxx @@ -42,9 +42,9 @@ namespace accessibility { // internal AccessibleContextBase::AccessibleContextBase ( - uno::Reference xParent, + const rtl::Reference& rpParent, const sal_Int16 aRole) - : mxParent(std::move(xParent)), + : mpParent(rpParent), meDescriptionOrigin(NotSet), meNameOrigin(NotSet), maRole(aRole) @@ -170,12 +170,16 @@ uno::Reference SAL_CALL nullptr); } +rtl::Reference AccessibleContextBase::implGetAccessibleParent() +{ + ensureAlive(); + return mpParent; +} uno::Reference SAL_CALL AccessibleContextBase::getAccessibleParent() { - ensureAlive(); - return mxParent; + return implGetAccessibleParent(); } sal_Int16 SAL_CALL @@ -256,10 +260,9 @@ lang::Locale SAL_CALL { ensureAlive(); // Delegate request to parent. - if (mxParent.is()) + if (mpParent.is()) { - uno::Reference xParentContext ( - mxParent->getAccessibleContext()); + uno::Reference xParentContext(mpParent->getAccessibleContext()); if (xParentContext.is()) return xParentContext->getLocale (); } @@ -309,7 +312,7 @@ void SAL_CALL AccessibleContextBase::disposing() comphelper::OAccessible::disposing(); - mxParent.clear(); + mpParent.clear(); mxRelationSet.clear(); } diff --git a/include/editeng/AccessibleContextBase.hxx b/include/editeng/AccessibleContextBase.hxx index 68ac262db105..6a73a11fd1ce 100644 --- a/include/editeng/AccessibleContextBase.hxx +++ b/include/editeng/AccessibleContextBase.hxx @@ -41,9 +41,8 @@ public: NotSet }; - AccessibleContextBase ( - css::uno::Reference< css::accessibility::XAccessible> xParent, - const sal_Int16 aRole); + AccessibleContextBase(const rtl::Reference& rpParent, + const sal_Int16 aRole); virtual ~AccessibleContextBase() override; @@ -149,8 +148,8 @@ public: getAccessibleChild (sal_Int64 nIndex) override; /// Return a reference to the parent. - virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL - getAccessibleParent() override; + virtual css::uno::Reference + SAL_CALL getAccessibleParent() override final; /// Return this object's role. virtual sal_Int16 SAL_CALL @@ -204,6 +203,8 @@ public: */ bool IsDisposed() const; + rtl::Reference implGetAccessibleParent(); + protected: /** The state set. */ @@ -236,7 +237,7 @@ protected: private: /// Reference to the parent object. - css::uno::Reference< css::accessibility::XAccessible> mxParent; + rtl::Reference mpParent; /** Description of this object. This is not a constant because it can be set from the outside. Furthermore, it changes according to the diff --git a/include/svx/AccessibleShapeInfo.hxx b/include/svx/AccessibleShapeInfo.hxx index cae96703b9ea..867f2da7cb4e 100644 --- a/include/svx/AccessibleShapeInfo.hxx +++ b/include/svx/AccessibleShapeInfo.hxx @@ -56,8 +56,7 @@ public: /** The accessible parent object of the shape. */ - css::uno::Reference< - css::accessibility::XAccessible> mxParent; + rtl::Reference mpParent; /** This object that may be realized by the same implementation as that of that of mxParent can be used to modify @@ -68,12 +67,9 @@ public: /** Copy the given values into the members described above. */ - AccessibleShapeInfo ( - css::uno::Reference< - css::drawing::XShape> xShape, - css::uno::Reference< - css::accessibility::XAccessible> xParent, - IAccessibleParent* pChildrenManager); + AccessibleShapeInfo(css::uno::Reference xShape, + const rtl::Reference& rpParent, + IAccessibleParent* pChildrenManager); /** Copy the given values into the members described above. The accessible parent implementation object is set to NULL. diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index e8c9cc942f9d..01aa643b02ab 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -417,7 +417,7 @@ bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurrentC { // create the new child rtl::Reference< ::accessibility::AccessibleShape > pReplacement(::accessibility::ShapeTypeHandler::Instance().CreateAccessibleObject ( - ::accessibility::AccessibleShapeInfo ( _rxShape, pCurrentChild->getAccessibleParent(), this ), + ::accessibility::AccessibleShapeInfo ( _rxShape, pCurrentChild->implGetAccessibleParent(), this ), _rShapeTreeInfo )); diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 8508e9d7426c..3e5c996ba851 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -95,7 +95,7 @@ OUString GetOptionalProperty ( // internal AccessibleShape::AccessibleShape(const AccessibleShapeInfo& rShapeInfo, const AccessibleShapeTreeInfo& rShapeTreeInfo) - : ImplInheritanceHelper(rShapeInfo.mxParent, AccessibleRole::SHAPE) + : ImplInheritanceHelper(rShapeInfo.mpParent, AccessibleRole::SHAPE) , mxShape(rShapeInfo.mxShape) , maShapeTreeInfo(rShapeTreeInfo) , m_nIndexInParent(-1) diff --git a/svx/source/accessibility/AccessibleShapeInfo.cxx b/svx/source/accessibility/AccessibleShapeInfo.cxx index 08cf6d74e17b..3e473c9ab565 100644 --- a/svx/source/accessibility/AccessibleShapeInfo.cxx +++ b/svx/source/accessibility/AccessibleShapeInfo.cxx @@ -25,10 +25,10 @@ namespace accessibility { AccessibleShapeInfo::AccessibleShapeInfo ( css::uno::Reference xShape, - css::uno::Reference xParent, + const rtl::Reference& rpParent, IAccessibleParent* pChildrenManager) : mxShape (std::move(xShape)), - mxParent (std::move(xParent)), + mpParent (rpParent), mpChildrenManager (pChildrenManager) { // empty. @@ -37,7 +37,7 @@ AccessibleShapeInfo::AccessibleShapeInfo ( AccessibleShapeInfo::AccessibleShapeInfo(css::uno::Reference xShape, const rtl::Reference& rpParent) : mxShape(std::move(xShape)) - , mxParent(rpParent) + , mpParent(rpParent) , mpChildrenManager(nullptr) { // empty. @@ -45,7 +45,7 @@ AccessibleShapeInfo::AccessibleShapeInfo(css::uno::ReferencegetAccessibleParent(), this ); + AccessibleShapeInfo aShapeInfo(_rxShape, pCurrentChild->implGetAccessibleParent(), this); // create the new child rtl::Reference pNewChild(ShapeTypeHandler::Instance().CreateAccessibleObject ( aShapeInfo, diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index dada20babe12..c8f05c332bcf 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -2785,7 +2785,7 @@ bool SwAccessibleMap::ReplaceChild ( // we might be the only one that // holds it. // Also get keep parent. - uno::Reference < XAccessible > xParent( pCurrentChild->getAccessibleParent() ); + rtl::Reference pParent = pCurrentChild->implGetAccessibleParent(); pCurrentChild = nullptr; // will be released by dispose A11yDispose( nullptr, pObj, nullptr ); @@ -2795,8 +2795,7 @@ bool SwAccessibleMap::ReplaceChild ( // create the new child ::accessibility::ShapeTypeHandler& rShapeTypeHandler = ::accessibility::ShapeTypeHandler::Instance(); - ::accessibility::AccessibleShapeInfo aShapeInfo( - xShape, xParent, this ); + ::accessibility::AccessibleShapeInfo aShapeInfo(xShape, pParent, this); rtl::Reference< ::accessibility::AccessibleShape> pReplacement( rShapeTypeHandler.CreateAccessibleObject ( aShapeInfo, mpShapeMap->GetInfo() ));