diff options
-rw-r--r-- | svx/source/tbxctrls/StylesPreviewWindow.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index a45289e15348..16a435fdb217 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -45,11 +45,14 @@ #include <editeng/emphasismarkitem.hxx> #include <editeng/brushitem.hxx> +#include <i18nlangtag/mslangid.hxx> + #include <svx/xfillit0.hxx> #include <svx/svddef.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> @@ -269,7 +272,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); |