summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-08-09 14:43:55 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-08-10 08:07:04 +0200
commit7c8c71ecf7dc3d86ebe783de8f4886c0d8b896f0 (patch)
treeab5f54552e5ce6b527c4c8f25c3d835aa6b453d6
parent218a7650a5cf03f895bed19c68d6f02daec536e9 (diff)
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.mehrbrodt@allotropia.de>
-rw-r--r--sw/source/core/access/AccessibilityCheck.cxx14
1 files changed, 11 insertions, 3 deletions
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());
+ }
}
};