sw/source/core/access/AccessibilityCheck.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 13d51d47e8c7c8cca6d1271dfad42e0af982945f
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Fri Aug 11 11:23:35 2023 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Mon Aug 14 17:24:18 2023 +0200

    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.ext...@allotropia.de>

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();
+            }
         }
     }
 };

Reply via email to