sw/source/core/access/AccessibilityCheck.cxx | 22 ++++++++------------ sw/source/core/inc/AccessibilityCheck.hxx | 2 - sw/source/core/txtnode/OnlineAccessibilityCheck.cxx | 2 - 3 files changed, 11 insertions(+), 15 deletions(-)
New commits: commit 4c71b0ac5fcb3ebe1e88721c49be8a6e0b9dcdf9 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Tue Jun 13 11:25:36 2023 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Thu Jun 15 09:26:30 2023 +0200 tdf#155728 - A11y sidebar: fix Update issue list after fixing an issue in case of SdrObjects. Change-Id: I45608d423c0da0f1a983dcfad43562c3d7c9ee67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152953 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> (cherry picked from commit 4bfdc5b1aeee65bfbc985452a90cc43868682f0a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153077 diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 05d2634db863..802ad2c8dea3 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1337,7 +1337,7 @@ public: } // end anonymous namespace // Check Shapes, TextBox -void AccessibilityCheck::checkObject(SdrObject* pObject) +void AccessibilityCheck::checkObject(SwNode* pCurrent, SdrObject* pObject) { if (!pObject) return; @@ -1381,6 +1381,8 @@ void AccessibilityCheck::checkObject(SdrObject* pObject) pIssue->setObjectID(pObject->GetName()); pIssue->setDoc(*m_pDoc); + if (pCurrent) + pIssue->setNode(pCurrent); } } } @@ -1469,19 +1471,13 @@ void AccessibilityCheck::check() if (pNodeCheck) pNodeCheck->check(pNode); } - } - } - IDocumentDrawModelAccess& rDrawModelAccess = m_pDoc->getIDocumentDrawModelAccess(); - auto* pModel = rDrawModelAccess.GetDrawModel(); - for (sal_uInt16 nPage = 0; nPage < pModel->GetPageCount(); ++nPage) - { - SdrPage* pPage = pModel->GetPage(nPage); - for (size_t nObject = 0; nObject < pPage->GetObjCount(); ++nObject) - { - SdrObject* pObject = pPage->GetObj(nObject); - if (pObject) - checkObject(pObject); + for (SwFrameFormat* const& pFrameFormat : pNode->GetAnchoredFlys()) + { + SdrObject* pObject = pFrameFormat->FindSdrObject(); + if (pObject) + checkObject(pNode, pObject); + } } } } diff --git a/sw/source/core/inc/AccessibilityCheck.hxx b/sw/source/core/inc/AccessibilityCheck.hxx index c7613e8829a4..caaff1944842 100644 --- a/sw/source/core/inc/AccessibilityCheck.hxx +++ b/sw/source/core/inc/AccessibilityCheck.hxx @@ -49,7 +49,7 @@ public: } void check() override; - void checkObject(SdrObject* pObject); + void checkObject(SwNode* pNode, SdrObject* pObject); void checkNode(SwNode* pNode); void checkDocumentProperties(); }; diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index 20d0ac39c10e..629497c50bac 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -134,7 +134,7 @@ void OnlineAccessibilityCheck::runAccessibilityCheck(SwNode* pNode) { SdrObject* pObject = pFrameFormat->FindSdrObject(); if (pObject) - m_aAccessibilityCheck.checkObject(pObject); + m_aAccessibilityCheck.checkObject(pNode, pObject); } auto aCollection = m_aAccessibilityCheck.getIssueCollection();