sw/source/core/access/AccessibilityCheck.cxx |    7 +++++--
 sw/source/core/access/AccessibilityIssue.cxx |   25 +++++++++++++++++++------
 2 files changed, 24 insertions(+), 8 deletions(-)

New commits:
commit 50f6e719764d6746220dedc78a8dd4654a791b1d
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Mon Aug 14 14:37:04 2023 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
CommitDate: Wed Aug 30 14:58:59 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
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155905

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 2cffffc3d247..bf0d4aeb8616 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1317,8 +1317,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:

Reply via email to