include/sfx2/sfxsids.hrc | 1 + sfx2/sdi/sfx.sdi | 18 ++++++++++++++++++ sw/sdi/_docsh.sdi | 6 ++++++ sw/sdi/swriter.sdi | 6 +++--- sw/source/core/access/AccessibilityCheck.cxx | 8 ++++++-- sw/source/core/access/AccessibilityIssue.cxx | 19 +++++++++++++++++-- sw/source/core/inc/AccessibilityIssue.hxx | 1 + sw/source/uibase/app/docst.cxx | 4 +++- 8 files changed, 55 insertions(+), 8 deletions(-)
New commits: commit 444640a02ee3cfef92a5061c6934c4e0a0a1eaa6 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Tue Aug 8 21:06:59 2023 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Wed Aug 30 14:58:42 2023 +0200 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.mehrbr...@allotropia.de> (cherry picked from commit b4cbf44e8d5072e79b62e6b4e3b1c2480e4a34f3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155785 diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index f21e1141bce7..9e5d00d7da90 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -375,6 +375,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 6c45a26b7896..7762d6788db5 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 02632d0d3ec9..2cffffc3d247 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -1330,8 +1330,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 d4a05bf2a173..e260dd67dc6c 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -360,6 +360,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: @@ -492,7 +493,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);