sw/source/core/access/AccessibilityCheck.cxx | 7 +++++-- sw/source/core/access/AccessibilityIssue.cxx | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-)
New commits: commit 8386d8e51067b13124ed7cbb693719c0b6463601 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Mon Aug 14 14:37:04 2023 +0200 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Thu Aug 17 16:09:17 2023 +0200 tdf#156654 - A11Y - fix no fixable button for warning about "Document default language is not set." Open dialog "Tools/Options/Language Settings - Language" for fixing the issue for the actual document. Follow-up of ca9cb1df613789d99154d50e77847c3e32330642 (tdf#156591 - A11Y - add fix button for "Style has no language set.") Change-Id: I0d13ad49b8f2eb196e4212f3e3719cf036087dc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155665 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> Tested-by: Jenkins diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 1022337e73b7..16981ccacb06 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1361,8 +1361,11 @@ public: LanguageType eLanguage = rLang.GetLanguage(); if (eLanguage == LANGUAGE_NONE) { - lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_DEFAULT_LANGUAGE), - sfx::AccessibilityIssueID::DOCUMENT_LANGUAGE); + auto pIssue = lclAddIssue(m_rIssueCollection, SwResId(STR_DOCUMENT_DEFAULT_LANGUAGE), + sfx::AccessibilityIssueID::DOCUMENT_LANGUAGE); + pIssue->setIssueObject(IssueObject::LANGUAGE_NOT_SET); + pIssue->setObjectID(OUString()); + pIssue->setDoc(*pDoc); } else { diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index 5c1dddd744ad..1cb1a9a87213 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -262,12 +262,25 @@ void AccessibilityIssue::quickFixIssue() const uno::Reference<frame::XModel> xModel(m_pDoc->GetDocShell()->GetModel(), uno::UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> aArgs{ - comphelper::makePropertyValue("Param", m_sObjectID), - comphelper::makePropertyValue("Family", sal_Int16(SfxStyleFamily::Para)) - }; - comphelper::dispatchCommand(".uno:EditStyleFont", - xModel->getCurrentController()->getFrame(), aArgs); + if (m_sObjectID.isEmpty()) + { + // open the dialog "Tools/Options/Language Settings - Language" + uno::Sequence<beans::PropertyValue> aArgs{ comphelper::makePropertyValue( + "Language", OUString("*")) }; + + comphelper::dispatchCommand(".uno:LanguageStatus", + xModel->getCurrentController()->getFrame(), aArgs); + } + else + { + uno::Sequence<beans::PropertyValue> aArgs{ + comphelper::makePropertyValue("Param", m_sObjectID), + comphelper::makePropertyValue("Family", sal_Int16(SfxStyleFamily::Para)) + }; + + comphelper::dispatchCommand(".uno:EditStyleFont", + xModel->getCurrentController()->getFrame(), aArgs); + } } break; default: