summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKevin Suo <suokunlong@126.com>2021-11-01 14:15:19 +0800
committerCaolán McNamara <caolanm@redhat.com>2021-11-01 17:20:38 +0100
commit836e37bac767ce6eea4b0e0c9342976e8238cc46 (patch)
treefcede61b052627866905e4aea57c0affabadbc10 /sc
parent1b7fa9180c256874d225a33878a09412f30c7b07 (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> (cherry picked from commit 3b977328dfbe613d925dc52c22e36b7e15a34ada) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124472 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/orcus/interface.cxx6
1 files changed, 6 insertions, 0 deletions
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)