diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-08-08 21:06:59 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2023-08-16 17:03:47 +0200 |
commit | b4cbf44e8d5072e79b62e6b4e3b1c2480e4a34f3 (patch) | |
tree | 90c2eaa33e958ee6076b062165cd57616d0cd31c | |
parent | c2164850f20d9342db94faa84c78fbb5b976552e (diff) |
tdf#156591 - A11Y - add fix button for "Style has no language set."
Open style language character settings if the language is set to 'None'.
Add EditStyleFont uno command for editing directly Font of paragraph styles.
Change-Id: I8b7d7880cc77f7352edac089ee95b4a6d0744575
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155494
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
-rw-r--r-- | include/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 18 | ||||
-rw-r--r-- | sw/sdi/_docsh.sdi | 6 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 6 | ||||
-rw-r--r-- | sw/source/core/access/AccessibilityCheck.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/access/AccessibilityIssue.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/inc/AccessibilityIssue.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 4 |
8 files changed, 55 insertions, 8 deletions
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index b88b778714a8..cc94d98ac664 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -374,6 +374,7 @@ class SvxZoomItem; #define SID_STYLE_APPLY TypedWhichId<SfxStringItem>(SID_SFX_START + 552) #define SID_STYLE_FAMILY TypedWhichId<SfxUInt16Item>(SID_SFX_START + 553) #define SID_STYLE_FAMILYNAME TypedWhichId<SfxStringItem>(SID_SFX_START + 566) +#define SID_STYLE_FONT TypedWhichId<SfxStringItem>(SID_SFX_START + 558) #define SID_STYLE_WATERCAN TypedWhichId<SfxBoolItem>(SID_SFX_START + 554) #define SID_STYLE_NEW_BY_EXAMPLE TypedWhichId<SfxStringItem>(SID_SFX_START + 555) #define SID_STYLE_UPDATE_BY_EXAMPLE TypedWhichId<SfxStringItem>(SID_SFX_START + 556) diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 4adb0f1b94fe..6541b39e47cd 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -1103,6 +1103,24 @@ SfxVoidItem EditStyle SID_STYLE_EDIT ] +SfxVoidItem EditStyleFont SID_STYLE_FONT +(SfxStringItem Param SID_STYLE_FONT,SfxUInt16Item Family SID_STYLE_FAMILY) +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = SfxGroupId::Template; +] + + SfxVoidItem HideStyle SID_STYLE_HIDE (SfxStringItem Param SID_STYLE_HIDE,SfxUInt16Item Family SID_STYLE_FAMILY) [ diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi index 60435805d761..5a398feff6d8 100644 --- a/sw/sdi/_docsh.sdi +++ b/sw/sdi/_docsh.sdi @@ -42,6 +42,12 @@ interface BaseTextDocument StateMethod = StateStyleSheet ; ] + SID_STYLE_FONT + [ + ExecMethod = ExecStyleSheet ; + StateMethod = StateStyleSheet ; + ] + SID_STYLE_DELETE [ ExecMethod = ExecStyleSheet ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 92fc37a342a3..56b381881939 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -4909,9 +4909,9 @@ SfxVoidItem PageAreaDialog FN_FORMAT_PAGE_AREA_DLG RecordPerSet; Asynchron; - AccelConfig = TRUE, - MenuConfig = TRUE, - ToolBoxConfig = TRUE, + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, GroupId = SfxGroupId::Format; ] diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index c73de2bccfc6..1022337e73b7 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1374,8 +1374,12 @@ public: OUString sName = pTextFormatCollection->GetName(); OUString sIssueText = SwResId(STR_STYLE_NO_LANGUAGE).replaceAll("%STYLE_NAME%", sName); - lclAddIssue(m_rIssueCollection, sIssueText, - sfx::AccessibilityIssueID::STYLE_LANGUAGE); + + auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText, + sfx::AccessibilityIssueID::STYLE_LANGUAGE); + pIssue->setIssueObject(IssueObject::LANGUAGE_NOT_SET); + pIssue->setObjectID(sName); + pIssue->setDoc(*pDoc); } } } diff --git a/sw/source/core/access/AccessibilityIssue.cxx b/sw/source/core/access/AccessibilityIssue.cxx index 6810cc05cdfc..5c1dddd744ad 100644 --- a/sw/source/core/access/AccessibilityIssue.cxx +++ b/sw/source/core/access/AccessibilityIssue.cxx @@ -51,7 +51,8 @@ bool AccessibilityIssue::canGotoIssue() const { if (m_pDoc && m_eIssueObject != IssueObject::UNKNOWN && m_eIssueObject != IssueObject::DOCUMENT_TITLE - && m_eIssueObject != IssueObject::DOCUMENT_BACKGROUND) + && m_eIssueObject != IssueObject::DOCUMENT_BACKGROUND + && m_eIssueObject != IssueObject::LANGUAGE_NOT_SET) return true; return false; } @@ -149,7 +150,8 @@ bool AccessibilityIssue::canQuickFixIssue() const return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == IssueObject::OLE || m_eIssueObject == IssueObject::SHAPE || m_eIssueObject == IssueObject::FORM || m_eIssueObject == IssueObject::DOCUMENT_TITLE - || m_eIssueObject == IssueObject::DOCUMENT_BACKGROUND; + || m_eIssueObject == IssueObject::DOCUMENT_BACKGROUND + || m_eIssueObject == IssueObject::LANGUAGE_NOT_SET; } void AccessibilityIssue::quickFixIssue() const @@ -255,6 +257,19 @@ void AccessibilityIssue::quickFixIssue() const xModel->getCurrentController()->getFrame(), {}); } break; + case IssueObject::LANGUAGE_NOT_SET: + { + 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); + } + break; default: break; } diff --git a/sw/source/core/inc/AccessibilityIssue.hxx b/sw/source/core/inc/AccessibilityIssue.hxx index 7a793fe8a60e..82474e17bdc5 100644 --- a/sw/source/core/inc/AccessibilityIssue.hxx +++ b/sw/source/core/inc/AccessibilityIssue.hxx @@ -28,6 +28,7 @@ enum class IssueObject TEXT, DOCUMENT_TITLE, DOCUMENT_BACKGROUND, + LANGUAGE_NOT_SET, FOOTENDNOTE, TEXTFRAME, }; diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 9838e04c3f09..8dcff2903414 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -375,6 +375,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) [[fallthrough]]; case SID_STYLE_EDIT: + case SID_STYLE_FONT: case SID_STYLE_DELETE: case SID_STYLE_HIDE: case SID_STYLE_SHOW: @@ -512,7 +513,8 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) switch(nSlot) { case SID_STYLE_EDIT: - Edit(rReq.GetFrameWeld(), aParam, {}, nFamily, nMask, false, {}, pActShell); + case SID_STYLE_FONT: + Edit(rReq.GetFrameWeld(), aParam, {}, nFamily, nMask, false, (nSlot == SID_STYLE_FONT) ? "font" : OUString(), pActShell); break; case SID_STYLE_DELETE: Delete(aParam, nFamily); |