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>
diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx
index 250f1b4..302d26c 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);
}
}
}