related tdf#57423: make a11y checker accept image description too
For LibreOffice, alt text and image description text are treated mostly the same during PDF export (and merged, if both are set), so having at least one of them set should make the checker happy enough. Change-Id: I9e54bcf52dee323fdbdd4a3015797a59efb7b42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151695 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
|
||||
|
||||
#define STR_NO_ALT NC_("STR_NO_ALT", "No alt text for graphic “%OBJECT_NAME%”.")
|
||||
#define STR_NO_ALT NC_("STR_NO_ALT", "No alt or description text for graphic “%OBJECT_NAME%”.")
|
||||
#define STR_TABLE_MERGE_SPLIT NC_("STR_TABLE_MERGE_SPLIT", "Table “%OBJECT_NAME%” contains merges or splits.")
|
||||
#define STR_FAKE_NUMBERING NC_("STR_FAKE_NUMBERING", "Simulated numbering “%NUMBERING%”.")
|
||||
#define STR_HYPERLINK_TEXT_IS_LINK NC_("STR_HYPERLINK_TEXT_IS_LINK", "Hyperlink text is the same as the link address “%LINK%”.")
|
||||
|
||||
@@ -48,15 +48,14 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testTableSplitMergeAndAltText)
|
||||
sw::AccessibilityCheck aCheck(pDoc);
|
||||
aCheck.check();
|
||||
auto& aIssues = aCheck.getIssueCollection().getIssues();
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(7), aIssues.size());
|
||||
CPPUNIT_ASSERT_EQUAL(size_t(6), aIssues.size());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::NO_ALT_GRAPHIC, aIssues[0]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::NO_ALT_OLE, aIssues[1]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, aIssues[1]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, aIssues[2]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, aIssues[3]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, aIssues[4]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_MERGE_SPLIT, aIssues[5]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::NO_ALT_SHAPE, aIssues[6]->m_eIssueID);
|
||||
CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::NO_ALT_SHAPE, aIssues[5]->m_eIssueID);
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckParagraphIssues)
|
||||
|
||||
@@ -97,8 +97,7 @@ class NoTextNodeAltTextCheck : public NodeCheck
|
||||
if (!pNoTextNode)
|
||||
return;
|
||||
|
||||
OUString sAlternative = pNoTextNode->GetTitle();
|
||||
if (!sAlternative.isEmpty())
|
||||
if (!pNoTextNode->GetTitle().isEmpty() || !pNoTextNode->GetDescription().isEmpty())
|
||||
return;
|
||||
|
||||
OUString sName = pNoTextNode->GetFlyFormat()->GetName();
|
||||
|
||||
Reference in New Issue
Block a user