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

New commits:
commit 7c8c71ecf7dc3d86ebe783de8f4886c0d8b896f0
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed Aug 9 14:43:55 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Thu Aug 10 08:07:04 2023 +0200

    tdf#156614 - A11Y - fix not clickable warning about fake forms
    
    Make the warning message clickable and select the text.
    
    Change-Id: I5b503ba278980c128bbef83631dabc897bb33b14
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155519
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 80aef2c4123f..1561bf04c00c 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1122,10 +1122,10 @@ public:
         if (!pCurrent->IsTextNode())
             return;
 
-        const auto& text = pCurrent->GetTextNode()->GetText();
+        SwTextNode* pTextNode = pCurrent->GetTextNode();
+        const auto& text = pTextNode->GetText();
 
         // Series of tests to detect if there are fake forms in the text.
-
         bool bCheck = text.indexOf("___") == -1; // Repeated underscores.
 
         if (bCheck)
@@ -1142,7 +1142,15 @@ public:
 
         // Checking if all the tests are passed successfully. If not, adding a 
warning.
         if (!bCheck)
-            lclAddIssue(m_rIssueCollection, 
SwResId(STR_NON_INTERACTIVE_FORMS));
+        {
+            sal_Int32 nStart = 0;
+            auto pIssue = lclAddIssue(m_rIssueCollection, 
SwResId(STR_NON_INTERACTIVE_FORMS));
+            pIssue->setIssueObject(IssueObject::TEXT);
+            pIssue->setNode(pTextNode);
+            pIssue->setDoc(pTextNode->GetDoc());
+            pIssue->setStart(nStart);
+            pIssue->setEnd(nStart + text.getLength());
+        }
     }
 };
 

Reply via email to