diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-06-08 11:33:13 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2023-06-12 09:37:03 +0200 |
commit | 1b0420e9980324f04bfd4b1316b572331f1e83bc (patch) | |
tree | 932ab70caf7d387841d3d32a99ef11bb4fdb51a5 | |
parent | d384ccdb04ebeb8b094e6d9a2ddf4e5aea5327c8 (diff) |
tdf#154943 - Accessibility checker: fix no warn of decorative-flagged image
If an image marked as Decorative it will be irrelevant for a11y,
and no warning will be on the accessibility sidebar.
Change-Id: If4d25fd8043549832a70b2c2be5aa754c76d9c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152737
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
-rw-r--r-- | sw/source/core/access/AccessibilityCheck.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 250f1b45f901..302d26c9c06f 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -114,12 +114,17 @@ class NoTextNodeAltTextCheck : public NodeCheck } else if (pNoTextNode->IsGrfNode()) { - auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText, - sfx::AccessibilityIssueID::NO_ALT_GRAPHIC); - pIssue->setDoc(pNoTextNode->GetDoc()); - pIssue->setIssueObject(IssueObject::GRAPHIC); - pIssue->setObjectID(pNoTextNode->GetFlyFormat()->GetName()); - pIssue->setNode(pNoTextNode); + const SwFrameFormat* pFrameFormat = pNoTextNode->GetFlyFormat(); + const SfxBoolItem* pIsDecorItem = pFrameFormat->GetItemIfSet(RES_DECORATIVE); + if (!(pIsDecorItem && pIsDecorItem->GetValue())) + { + auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText, + sfx::AccessibilityIssueID::NO_ALT_GRAPHIC); + pIssue->setDoc(pNoTextNode->GetDoc()); + pIssue->setIssueObject(IssueObject::GRAPHIC); + pIssue->setObjectID(pNoTextNode->GetFlyFormat()->GetName()); + pIssue->setNode(pNoTextNode); + } } } |