diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-10-31 11:09:46 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-11-18 02:06:13 +0100 |
commit | 45d1fca81991f0d6837c98d6be6fe0d21d566fa5 (patch) | |
tree | aca67d72030fee759845d61d13434184618501c5 /sw/source/core | |
parent | 00128f14c400b661444676410b2088aca357291c (diff) |
sw: run document properties a11y checks on a loaded document
Change-Id: Iba98a91a61955af52651348409f88244d1eed2c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142216
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/access/AccessibilityCheck.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/inc/AccessibilityCheck.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/txtnode/OnlineAccessibilityCheck.cxx | 11 |
3 files changed, 23 insertions, 1 deletions
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 802dda2b95cd..ac558a44c69e 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1411,7 +1411,7 @@ void AccessibilityCheck::checkNode(SwNode* pNode) } } -void AccessibilityCheck::check() +void AccessibilityCheck::checkDocumentProperties() { if (m_pDoc == nullptr) return; @@ -1424,6 +1424,16 @@ void AccessibilityCheck::check() if (pDocumentCheck) pDocumentCheck->check(m_pDoc); } +} + +void AccessibilityCheck::check() +{ + if (m_pDoc == nullptr) + return; + + init(); + + checkDocumentProperties(); auto const& pNodes = m_pDoc->GetNodes(); SwNode* pNode = nullptr; diff --git a/sw/source/core/inc/AccessibilityCheck.hxx b/sw/source/core/inc/AccessibilityCheck.hxx index 1ff4cf5b16f7..c7613e8829a4 100644 --- a/sw/source/core/inc/AccessibilityCheck.hxx +++ b/sw/source/core/inc/AccessibilityCheck.hxx @@ -51,6 +51,7 @@ public: void check() override; void checkObject(SdrObject* pObject); void checkNode(SwNode* pNode); + void checkDocumentProperties(); }; } // end sw namespace diff --git a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx index db1212600644..1188bc7d06c5 100644 --- a/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx +++ b/sw/source/core/txtnode/OnlineAccessibilityCheck.cxx @@ -135,11 +135,22 @@ void OnlineAccessibilityCheck::runAccessibilityCheck(SwNode* pNode) = std::make_unique<sfx::AccessibilityIssueCollection>(aCollection); } +void OnlineAccessibilityCheck::runDocumentLevelAccessibilityCheck() +{ + m_aAccessibilityCheck.getIssueCollection().clear(); + m_aAccessibilityCheck.checkDocumentProperties(); + auto aCollection = m_aAccessibilityCheck.getIssueCollection(); + m_pDocumentAccessibilityIssues + = std::make_unique<sfx::AccessibilityIssueCollection>(aCollection); +} + void OnlineAccessibilityCheck::initialCheck() { if (m_bInitialCheck) return; + runDocumentLevelAccessibilityCheck(); + auto const& pNodes = m_rDocument.GetNodes(); for (SwNodeOffset n(0); n < pNodes.Count(); ++n) { |