diff options
author | Kevin Suo <suokunlong@126.com> | 2021-11-01 14:15:19 +0800 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-01 13:44:48 +0100 |
commit | 3b977328dfbe613d925dc52c22e36b7e15a34ada (patch) | |
tree | 44c8acc188ab499d0c5fa6624d826d6bee545ae9 /sc | |
parent | b34a8f977cf043153dd56a7f83b25e0b11b7a523 (diff) |
tdf#138475: also set font size/weight/posture for CJK/CTL languages...
when parsing the default Calc styles.
As an initial matter, orcus currently does not support XML_font_size_asian,
XML_font_size_complex, XML_font_weight_asian, XML_font_weight_complex etc in:
https://gitlab.com/orcus/orcus/-/blob/master/src/liborcus/odf_styles_context.cpp#L128
While this need to be improved by Orcus, actually in Calc we provide
the default font attributes in sc/res/xml/styles.xml and it makes no
sense to set different font size/weight/posture for each language type.
As a result we apply the same font attributes of latin to all these
languages.
Change-Id: I1b105fecce45aa22c6b72e15305e25dc6669d2cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124536
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index f809edb816cd..65ace1c123ed 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1362,9 +1362,13 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const { FontItalic eItalic = mbItalic ? ITALIC_NORMAL : ITALIC_NONE; rSet.Put(SvxPostureItem(eItalic, ATTR_FONT_POSTURE)); + rSet.Put(SvxPostureItem(eItalic, ATTR_CJK_FONT_POSTURE)); + rSet.Put(SvxPostureItem(eItalic, ATTR_CTL_FONT_POSTURE)); FontWeight eWeight = mbBold ? WEIGHT_BOLD : WEIGHT_NORMAL; rSet.Put(SvxWeightItem(eWeight, ATTR_FONT_WEIGHT)); + rSet.Put(SvxWeightItem(eWeight, ATTR_CJK_FONT_WEIGHT)); + rSet.Put(SvxWeightItem(eWeight, ATTR_CTL_FONT_WEIGHT)); rSet.Put( SvxColorItem(maColor, ATTR_FONT_COLOR)); @@ -1372,6 +1376,8 @@ void ScOrcusStyles::font::applyToItemSet(SfxItemSet& rSet) const rSet.Put( SvxFontItem( FAMILY_DONTKNOW, maName, maName, PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, ATTR_FONT )); rSet.Put( SvxFontHeightItem (translateToInternal(mnSize, orcus::length_unit_t::point), 100, ATTR_FONT_HEIGHT)); + rSet.Put( SvxFontHeightItem (translateToInternal(mnSize, orcus::length_unit_t::point), 100, ATTR_CJK_FONT_HEIGHT)); + rSet.Put( SvxFontHeightItem (translateToInternal(mnSize, orcus::length_unit_t::point), 100, ATTR_CTL_FONT_HEIGHT)); } if (mbHasUnderlineAttr) |