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

New commits:
commit 8112e3dae2550acc43e064a69759ddbf7993142b
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Thu Aug 10 08:46:59 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Thu Aug 10 11:08:27 2023 +0200

    tdf#156619 - A11Y - fix not clickable warning about content control
    
    in header/footer. Goto content controls in header and footer.
    
    Change-Id: I1e7eda0e9ab73a94d3f4963630901ff6701b521f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155535
    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 9f157d3d8f1e..86684ab4d879 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1282,20 +1282,15 @@ private:
 /// Checking content controls in header or footer
 class ContentControlCheck : public NodeCheck
 {
-private:
-    // Boolean indicating if content controls in header or footer warning is 
already triggered.
-    bool m_bPrevPassed;
-
 public:
     ContentControlCheck(sfx::AccessibilityIssueCollection& rIssueCollection)
         : NodeCheck(rIssueCollection)
-        , m_bPrevPassed(true)
     {
     }
 
     void check(SwNode* pCurrent) override
     {
-        if (!m_bPrevPassed)
+        if (!pCurrent->IsContentNode())
             return;
 
         const SwTextNode* pTextNode = pCurrent->GetTextNode();
@@ -1311,9 +1306,12 @@ public:
                         const SwTextAttr* pHt = pHts->Get(i);
                         if (pHt->Which() == RES_TXTATR_CONTENTCONTROL)
                         {
-                            m_bPrevPassed = false;
-                            lclAddIssue(m_rIssueCollection,
-                                        
SwResId(STR_CONTENT_CONTROL_IN_HEADER_OR_FOOTER));
+                            auto pIssue
+                                = lclAddIssue(m_rIssueCollection,
+                                              
SwResId(STR_CONTENT_CONTROL_IN_HEADER_OR_FOOTER));
+                            pIssue->setIssueObject(IssueObject::TEXT);
+                            pIssue->setDoc(pCurrent->GetDoc());
+                            pIssue->setNode(pCurrent);
                             break;
                         }
                     }

Reply via email to