sw/inc/AccessibilityCheckStrings.hrc | 2 +- sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx | 7 +++---- sw/source/core/access/AccessibilityCheck.cxx | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-)
New commits: commit 5351b8789805154219fe57b92b41b17c0e0cd765 Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Fri May 12 10:42:56 2023 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Sat May 13 13:25:08 2023 +0200 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.behr...@allotropia.de> diff --git a/sw/inc/AccessibilityCheckStrings.hrc b/sw/inc/AccessibilityCheckStrings.hrc index 805f525b37e2..cb461b1013f8 100644 --- a/sw/inc/AccessibilityCheckStrings.hrc +++ b/sw/inc/AccessibilityCheckStrings.hrc @@ -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%”.") diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx index d24a0922b73e..2b99f49b0cb2 100644 --- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx +++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx @@ -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) diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index bae9b9d0c586..3a2bf556d112 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -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();