summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-06-13 11:25:36 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-06-15 08:13:22 +0200
commit8b9d524008955f6f681d0bde8ef32d3cb3a83214 (patch)
tree494cb5c6ff271571634b47fc7d04531efc5f9407 /sw/source
parentaf95fedde797ccfa85f4b876867b57015aa8b382 (diff)
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.mehrbrodt@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/AccessibilityCheck.cxx22
-rw-r--r--sw/source/core/inc/AccessibilityCheck.hxx2
-rw-r--r--sw/source/core/txtnode/OnlineAccessibilityCheck.cxx2
3 files changed, 11 insertions, 15 deletions
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();