editeng/source/accessibility/AccessibleContextBase.cxx | 9 +++------ include/editeng/AccessibleContextBase.hxx | 6 ++++-- sc/source/ui/Accessibility/AccessibleDocument.cxx | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-)
New commits: commit b048814f5eb2ed58c302a880a2eabf69473955e0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Nov 8 14:43:47 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 10 12:35:58 2023 +0100 loplugin:fieldcast in accessibility::AccessibleContextBase Change-Id: Ibd71c2e809731114d4415754c8fd94110bd5736b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx index 7143b7151bcf..df52b70e78a4 100644 --- a/editeng/source/accessibility/AccessibleContextBase.cxx +++ b/editeng/source/accessibility/AccessibleContextBase.cxx @@ -128,7 +128,7 @@ bool AccessibleContextBase::GetState (sal_Int64 aState) void AccessibleContextBase::SetRelationSet ( - const uno::Reference<XAccessibleRelationSet>& rxNewRelationSet) + const rtl::Reference<utl::AccessibleRelationSetHelper>& rxNewRelationSet) { // Try to emit some meaningful events indicating differing relations in // both sets. @@ -268,12 +268,9 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL ThrowIfDisposed (); // Create a copy of the relation set and return it. - ::utl::AccessibleRelationSetHelper* pRelationSet = - static_cast< ::utl::AccessibleRelationSetHelper*>(mxRelationSet.get()); - if (pRelationSet != nullptr) + if (mxRelationSet) { - return uno::Reference<XAccessibleRelationSet> ( - new ::utl::AccessibleRelationSetHelper (*pRelationSet)); + return new ::utl::AccessibleRelationSetHelper(*mxRelationSet); } else return uno::Reference<XAccessibleRelationSet>(nullptr); diff --git a/include/editeng/AccessibleContextBase.hxx b/include/editeng/AccessibleContextBase.hxx index d2152a9a4026..25f3ab8ceb55 100644 --- a/include/editeng/AccessibleContextBase.hxx +++ b/include/editeng/AccessibleContextBase.hxx @@ -28,9 +28,11 @@ #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> #include <editeng/editengdllapi.h> +#include <rtl/ref.hxx> namespace com::sun::star::accessibility { class XAccessibleRelationSet; } namespace com::sun::star::accessibility { struct AccessibleEventObject; } +namespace utl { class AccessibleRelationSetHelper; } namespace accessibility { @@ -157,7 +159,7 @@ public: @throws css::uno::RuntimeException */ void SetRelationSet ( - const css::uno::Reference< css::accessibility::XAccessibleRelationSet>& rxRelationSet); + const rtl::Reference< utl::AccessibleRelationSetHelper>& rxRelationSet); //===== XAccessible ===================================================== @@ -263,7 +265,7 @@ protected: /** The relation set. Relations can be set or removed by calling the <member>AddRelation</member> and <member>RemoveRelation</member> methods. */ - css::uno::Reference< css::accessibility::XAccessibleRelationSet> mxRelationSet; + rtl::Reference<utl::AccessibleRelationSetHelper> mxRelationSet; // This method is called from the component helper base class while disposing. virtual void SAL_CALL disposing() override; diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 3222cc289ed8..c309f1b1fe66 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -267,7 +267,7 @@ private: bool FindSelectedShapesChanges(const css::uno::Reference<css::drawing::XShapes>& xShapes) const; std::optional<ScAddress> GetAnchor(const uno::Reference<drawing::XShape>& xShape) const; - uno::Reference<XAccessibleRelationSet> GetRelationSet(const ScAccessibleShapeData* pData) const; + rtl::Reference<utl::AccessibleRelationSetHelper> GetRelationSet(const ScAccessibleShapeData* pData) const; void SetAnchor(const uno::Reference<drawing::XShape>& xShape, ScAccessibleShapeData* pData) const; void AddShape(const uno::Reference<drawing::XShape>& xShape, bool bCommitChange) const; void RemoveShape(const uno::Reference<drawing::XShape>& xShape) const; @@ -1125,7 +1125,7 @@ std::optional<ScAddress> ScChildrenShapes::GetAnchor(const uno::Reference<drawin return std::optional<ScAddress>(); } -uno::Reference<XAccessibleRelationSet> ScChildrenShapes::GetRelationSet(const ScAccessibleShapeData* pData) const +rtl::Reference<utl::AccessibleRelationSetHelper> ScChildrenShapes::GetRelationSet(const ScAccessibleShapeData* pData) const { rtl::Reference<utl::AccessibleRelationSetHelper> pRelationSet = new utl::AccessibleRelationSetHelper();