sc/source/filter/orcus/interface.cxx | 6 ++++++ 1 file changed, 6 insertions(+)
New commits: commit 836e37bac767ce6eea4b0e0c9342976e8238cc46 Author: Kevin Suo <suokunl...@126.com> AuthorDate: Mon Nov 1 14:15:19 2021 +0800 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Nov 1 17:20:38 2021 +0100 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.gran...@collabora.co.uk> (cherry picked from commit 3b977328dfbe613d925dc52c22e36b7e15a34ada) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124472 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 35fb72548a4c..78b9563bc842 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1360,9 +1360,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)); @@ -1370,6 +1374,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)