diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-08-11 11:23:35 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-08-14 17:24:18 +0200 |
commit | 13d51d47e8c7c8cca6d1271dfad42e0af982945f (patch) | |
tree | 66fe6137ba34c5d4742c4c0ab7f98be6fe68b788 /sw/source | |
parent | d8e012b6a71ed1499d0e25122cc65c13cdadddf6 (diff) |
tdf#156622 - A11Y - fix not clickable warning about blinking text
Make clickable and highlight the problematic text.
Change-Id: Ie53c74b0364d08e4299e4c27ff2744a8c547844e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155586
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/access/AccessibilityCheck.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 19683f9cf761..dddbb68bb966 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1039,7 +1039,8 @@ public: class BlinkingTextCheck : public NodeCheck { private: - void checkTextRange(uno::Reference<text::XTextRange> const& xTextRange) + void checkTextRange(uno::Reference<text::XTextRange> const& xTextRange, SwTextNode* pTextNode, + sal_Int32 nStart) { uno::Reference<beans::XPropertySet> xProperties(xTextRange, uno::UNO_QUERY); if (xProperties.is() && xProperties->getPropertySetInfo()->hasPropertyByName("CharFlash")) @@ -1049,7 +1050,12 @@ private: if (bBlinking) { - lclAddIssue(m_rIssueCollection, SwResId(STR_TEXT_BLINKING)); + auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_TEXT_BLINKING)); + pIssue->setIssueObject(IssueObject::TEXT); + pIssue->setNode(pTextNode); + pIssue->setDoc(pTextNode->GetDoc()); + pIssue->setStart(nStart); + pIssue->setEnd(nStart + xTextRange->getString().getLength()); } } } @@ -1073,11 +1079,15 @@ public: uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY); uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); + sal_Int32 nStart = 0; while (xRunEnum->hasMoreElements()) { uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY); if (xRun.is()) - checkTextRange(xRun); + { + checkTextRange(xRun, pTextNode, nStart); + nStart += xRun->getString().getLength(); + } } } }; |