svx/source/tbxctrls/StylesPreviewWindow.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
New commits: commit fe90a3bedc0495fc47127ad35477f43683fd81c6 Author: Szymon Kłos <[email protected]> AuthorDate: Mon Mar 28 07:53:54 2022 +0200 Commit: Szymon Kłos <[email protected]> CommitDate: Mon Mar 28 16:01:31 2022 +0200 Notebookbar style previews: use CJK or CTL fonts if needed Change-Id: I4757cf7af16a11895ec0c6e71257f2b4f02cda68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132159 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Mert Tumer <[email protected]> (cherry picked from commit f7c069e1008949a07481dc56e40bcd82343884dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132051 Reviewed-by: Szymon Kłos <[email protected]> diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index 2c27c2fb834f..77f74152f3fb 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -46,11 +46,14 @@ #include <editeng/emphasismarkitem.hxx> #include <editeng/brushitem.hxx> +#include <i18nlangtag/mslangid.hxx> + #include <svx/xfillit0.hxx> #include <svx/xdef.hxx> #include <svx/xflclit.hxx> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <cppuhelper/weak.hxx> @@ -267,7 +270,16 @@ void StyleItemController::DrawEntry(vcl::RenderContext& rRenderContext) Color aFontHighlight = COL_AUTO; - const SvxFontItem* const pFontItem = pItemSet->GetItem<SvxFontItem>(SID_ATTR_CHAR_FONT); + sal_Int16 nScriptType + = MsLangId::getScriptType(Application::GetSettings().GetUILanguageTag().getLanguageType()); + + sal_uInt16 nFontSlot = SID_ATTR_CHAR_FONT; + if (nScriptType == css::i18n::ScriptType::ASIAN) + nFontSlot = SID_ATTR_CHAR_CJK_FONT; + else if (nScriptType == css::i18n::ScriptType::COMPLEX) + nFontSlot = SID_ATTR_CHAR_CTL_FONT; + + const SvxFontItem* const pFontItem = pItemSet->GetItem<SvxFontItem>(nFontSlot); const SvxFontHeightItem* const pFontHeightItem = pItemSet->GetItem<SvxFontHeightItem>(SID_ATTR_CHAR_FONTHEIGHT);
