summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-03-28 07:53:54 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-03-28 10:27:26 +0200
commitf7c069e1008949a07481dc56e40bcd82343884dc (patch)
treef6d3a039a3de92bb93fafa2c3c03a00dc4cafda9
parentsc: fix crash in SdrPageView::GetPageWindow() (diff)
downloadcore-f7c069e1008949a07481dc56e40bcd82343884dc.tar.gz
core-f7c069e1008949a07481dc56e40bcd82343884dc.zip
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx14
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);