include/svx/AccessibleTextHelper.hxx | 2 - sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 22 +++++------ svx/source/accessibility/AccessibleTextHelper.cxx | 20 +++++----- 3 files changed, 23 insertions(+), 21 deletions(-)
New commits: commit d72f963b77e104662804cca0827cd110e7d9b61c Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:35:58 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:37 2025 +0200 sc a11y: Use OAccessible in ScNotesChildren ... instead of the abstract XAccessible UNO interface. Change-Id: Ida8118c45cd759c58e0beefc5eee9a2931b2bb8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189625 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index ddd11dbd3f4c..c6962aba57b6 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -61,7 +61,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; -typedef std::vector< uno::Reference< XAccessible > > ScXAccVector; +typedef std::vector<rtl::Reference<comphelper::OAccessible>> ScOAccVector; namespace { @@ -110,10 +110,10 @@ private: sal_Int32 AddNotes(const ScPreviewLocationData& rData, const tools::Rectangle& rVisRect, bool bMark, ScAccNotes& rNotes); static sal_Int8 CompareCell(const ScAddress& aCell1, const ScAddress& aCell2); - static void CollectChildren(const ScAccNote& rNote, ScXAccVector& rVector); + static void CollectChildren(const ScAccNote& rNote, ScOAccVector& rVector); sal_Int32 CheckChanges(const ScPreviewLocationData& rData, const tools::Rectangle& rVisRect, bool bMark, ScAccNotes& rOldNotes, ScAccNotes& rNewNotes, - ScXAccVector& rOldParas, ScXAccVector& rNewParas); + ScOAccVector& rOldParas, ScOAccVector& rNewParas); inline ScDocument* GetDocument() const; }; @@ -320,7 +320,7 @@ sal_Int8 ScNotesChildren::CompareCell(const ScAddress& aCell1, const ScAddress& return nResult; } -void ScNotesChildren::CollectChildren(const ScAccNote& rNote, ScXAccVector& rVector) +void ScNotesChildren::CollectChildren(const ScAccNote& rNote, ScOAccVector& rVector) { if (rNote.mpTextHelper) for (sal_Int32 i = 0; i < rNote.mnParaCount; ++i) @@ -329,7 +329,7 @@ void ScNotesChildren::CollectChildren(const ScAccNote& rNote, ScXAccVector& rVec sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData, const tools::Rectangle& rVisRect, bool bMark, ScAccNotes& rOldNotes, - ScAccNotes& rNewNotes, ScXAccVector& rOldParas, ScXAccVector& rNewParas) + ScAccNotes& rNewNotes, ScOAccVector& rOldParas, ScOAccVector& rNewParas) { sal_Int32 nCount = rData.GetNoteCountInRange(rVisRect, bMark); @@ -458,8 +458,8 @@ void ScNotesChildren::DataChanged(const tools::Rectangle& rVisRect) if (!mpViewShell) return; - ScXAccVector aNewParas; - ScXAccVector aOldParas; + ScOAccVector aNewParas; + ScOAccVector aOldParas; { ScAccNotes aNewMarks; mnParagraphs = CheckChanges(mpViewShell->GetLocationData(), rVisRect, true, maMarks, aNewMarks, aOldParas, aNewParas); commit 084249bc8786e4639385496acbc0bf94065d2c0d Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:32:38 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:31 2025 +0200 a11y: Return OAccessible in AccessibleTextHelper::GetChild Change-Id: I6599d050d7c961d6e86e55dd85ba913cdbfdfa13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189624 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/include/svx/AccessibleTextHelper.hxx b/include/svx/AccessibleTextHelper.hxx index 5aee049ce2d1..451885a5736e 100644 --- a/include/svx/AccessibleTextHelper.hxx +++ b/include/svx/AccessibleTextHelper.hxx @@ -348,7 +348,7 @@ public: @attention Don't call with locked mutexes. You may hold the solar mutex, but this method acquires it anyway. */ - css::uno::Reference<css::accessibility::XAccessible> GetChild(sal_Int64 i); + rtl::Reference<comphelper::OAccessible> GetChild(sal_Int64 i); // XAccessibleEventBroadcaster child related methods diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index e6bbd996a15c..ddd11dbd3f4c 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -224,7 +224,7 @@ struct ScParaFound uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const { - uno::Reference<XAccessible> xAccessible; + rtl::Reference<comphelper::OAccessible> pAccessible; if (nIndex < mnParagraphs) { @@ -238,7 +238,7 @@ uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const OSL_ENSURE((aItr->maNoteCell == maMarks[nIndex].maNoteCell) && (aItr->mbMarkNote == maMarks[nIndex].mbMarkNote), "wrong note found"); if (!aItr->mpTextHelper) aItr->mpTextHelper = CreateTextHelper(maMarks[nIndex].maNoteText, maMarks[nIndex].maRect, maMarks[nIndex].maNoteCell, maMarks[nIndex].mbMarkNote, nIndex + mnOffset); // the marks are the first and every mark has only one paragraph - xAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex()); + pAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex()); } else { @@ -255,12 +255,12 @@ uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const { if (!aItr->mpTextHelper) aItr->mpTextHelper = CreateTextHelper(aItr->maNoteText, aItr->maRect, aItr->maNoteCell, aItr->mbMarkNote, (nIndex - aParaFound.mnIndex) + mnOffset + maMarks.size()); - xAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex()); + pAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex()); } } } - return xAccessible; + return pAccessible; } namespace { diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index cd97ff96d50f..c8eb9180d9a7 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -1713,7 +1713,7 @@ sal_Int64 AccessibleTextHelper::GetChildCount() const #endif } -uno::Reference< XAccessible > AccessibleTextHelper::GetChild( sal_Int64 i ) +rtl::Reference<comphelper::OAccessible> AccessibleTextHelper::GetChild(sal_Int64 i) { SolarMutexGuard aGuard; commit 3ca9d14ffeaf5472047dda30c1d82affc022beb1 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Aug 14 18:26:45 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Aug 15 06:47:24 2025 +0200 a11y: Use more OAccessible in AccessibleTextHelper_Impl ... instead of the abstract XAccessible UNO interface. Change-Id: I15567d06a19d1efbd8e2b7af1fa21b2cacb43603 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189623 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index a29efbb76ece..cd97ff96d50f 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -85,14 +85,14 @@ public: // XAccessibleContext child handling methods sal_Int64 getAccessibleChildCount() const; - uno::Reference< XAccessible > getAccessibleChild( sal_Int64 i ); + rtl::Reference<comphelper::OAccessible> getAccessibleChild(sal_Int64 i); // XAccessibleEventBroadcaster child related methods void addAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ); void removeAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ); // XAccessibleComponent child related methods - uno::Reference< XAccessible > getAccessibleAtPoint( const awt::Point& aPoint ); + rtl::Reference<comphelper::OAccessible> getAccessibleAtPoint(const awt::Point& aPoint); SvxEditSourceAdapter& GetEditSource() const; @@ -1049,8 +1049,9 @@ void AccessibleTextHelper_Impl::ProcessQueue() // #109864# Enforce creation of this paragraph try { - FireEvent(AccessibleEventId::CHILD, uno::Any(getAccessibleChild(aFunctor.GetParaIndex() - - mnFirstVisibleChild + GetStartIndex()))); + FireEvent(AccessibleEventId::CHILD, + uno::Any(uno::Reference<XAccessible>(getAccessibleChild( + aFunctor.GetParaIndex() - mnFirstVisibleChild + GetStartIndex())))); } catch( const uno::Exception& ) { @@ -1420,7 +1421,7 @@ sal_Int64 AccessibleTextHelper_Impl::getAccessibleChildCount() const return mnLastVisibleChild - mnFirstVisibleChild + 1; } -uno::Reference< XAccessible > AccessibleTextHelper_Impl::getAccessibleChild( sal_Int64 i ) +rtl::Reference<comphelper::OAccessible> AccessibleTextHelper_Impl::getAccessibleChild(sal_Int64 i) { i -= GetStartIndex(); @@ -1464,7 +1465,8 @@ void AccessibleTextHelper_Impl::removeAccessibleEventListener( const uno::Refere } } -uno::Reference< XAccessible > AccessibleTextHelper_Impl::getAccessibleAtPoint( const awt::Point& _aPoint ) +rtl::Reference<comphelper::OAccessible> +AccessibleTextHelper_Impl::getAccessibleAtPoint(const awt::Point& _aPoint) { // make given position relative if (!mpFrontEnd.is()) @@ -1718,11 +1720,11 @@ uno::Reference< XAccessible > AccessibleTextHelper::GetChild( sal_Int64 i ) #ifdef DBG_UTIL mpImpl->CheckInvariants(); - uno::Reference< XAccessible > xRet = mpImpl->getAccessibleChild( i ); + rtl::Reference<comphelper::OAccessible> pRet = mpImpl->getAccessibleChild(i); mpImpl->CheckInvariants(); - return xRet; + return pRet; #else return mpImpl->getAccessibleChild( i ); #endif