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

New commits:
commit 2b2285f70bcc85ae26ad12b75859dae8800c6662
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed Aug 9 14:43:55 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Aug 11 16:02:06 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>
    (cherry picked from commit 61730db0931ac117971646df8f9f359df99a1cc6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155480
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index a7907c8992cd..462205fc65d6 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1129,10 +1129,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)
@@ -1149,7 +1149,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