summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-08-14 14:37:04 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-08-17 16:09:17 +0200
commit8386d8e51067b13124ed7cbb693719c0b6463601 (patch)
treee00ca42647152fdeb008bc21775615aef791a3e4 /sw
parente304163c8a70daab587f0b328554444513887779 (diff)
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.mehrbrodt@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/access/AccessibilityCheck.cxx7
-rw-r--r--sw/source/core/access/AccessibilityIssue.cxx25
2 files changed, 24 insertions, 8 deletions
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: