diff options
author | Justin Luth <justin_luth@sil.org> | 2022-05-13 06:18:23 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-05-16 21:27:15 +0200 |
commit | ace3a90f5cc383e30fd85f80a8ea4755159876cb (patch) | |
tree | ae2f3dd360dd92f89e14b6244fb4d262c1678dc1 | |
parent | forcepoint#97 avoid Invalid read of size 2 (diff) | |
download | core-ace3a90f5cc383e30fd85f80a8ea4755159876cb.tar.gz core-ace3a90f5cc383e30fd85f80a8ea4755159876cb.zip |
tdf#124820 sc: overwrite more character level font attributes
The issue here is that certain character properties applied
at the cell level did not clear out those properties from
the character runs. Specifically strikethrough, underline,
overline, italics, outline, shadow.
Specifically for xlsx import - where a default value is
specified in many cases instead of not being defined
at all - this meant that the cell change had no real
effect, since the direct properties have priority.
A 2010 commit 4ef978de83610b0e1912bce1d59432b9c382b9fc
did this for font, size, bold, and color.
Perhaps that was all that was needed at that time,
although even back these other properties probably
should have been handled as well, because the cell-change
didn't affect the entire contents.
In 2013 a LO 4.1 commit f54ce3e7f6d6aab7e34c54ad8eff06650e076fef
increased the impact during xlsx import.
I assume that adding the CTL/CJK attributes is also necessary.
Change-Id: Id933af1ce187a79851868a6a295b33758062fe3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134254
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
(cherry picked from commit f413eb0b43fa36edf69909f3821dfe6a54e3edf7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134363
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 331f50af8b93..3731f3d1d8f5 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -158,9 +158,22 @@ void ScEditUtil::RemoveCharAttribs( EditTextObject& rEditText, const ScPatternAt sal_uInt16 nCharType; } AttrTypeMap[] = { { ATTR_FONT, EE_CHAR_FONTINFO }, + { ATTR_CJK_FONT, EE_CHAR_FONTINFO_CJK }, + { ATTR_CTL_FONT, EE_CHAR_FONTINFO_CTL }, { ATTR_FONT_HEIGHT, EE_CHAR_FONTHEIGHT }, + { ATTR_CJK_FONT_HEIGHT, EE_CHAR_FONTHEIGHT_CJK }, + { ATTR_CTL_FONT_HEIGHT, EE_CHAR_FONTHEIGHT_CTL }, { ATTR_FONT_WEIGHT, EE_CHAR_WEIGHT }, - { ATTR_FONT_COLOR, EE_CHAR_COLOR } + { ATTR_CJK_FONT_WEIGHT, EE_CHAR_WEIGHT_CJK }, + { ATTR_CTL_FONT_WEIGHT, EE_CHAR_WEIGHT_CTL }, + { ATTR_FONT_POSTURE, EE_CHAR_ITALIC }, + { ATTR_CJK_FONT_POSTURE, EE_CHAR_ITALIC_CJK }, + { ATTR_CTL_FONT_POSTURE, EE_CHAR_ITALIC_CTL }, + { ATTR_FONT_COLOR, EE_CHAR_COLOR }, + { ATTR_FONT_UNDERLINE, EE_CHAR_UNDERLINE }, + { ATTR_FONT_CROSSEDOUT, EE_CHAR_STRIKEOUT }, + { ATTR_FONT_CONTOUR, EE_CHAR_OUTLINE }, + { ATTR_FONT_SHADOWED, EE_CHAR_SHADOW } }; const SfxItemSet& rSet = rAttr.GetItemSet(); |