sc/source/core/tool/editutil.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit ace3a90f5cc383e30fd85f80a8ea4755159876cb
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Fri May 13 06:18:23 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon May 16 21:27:15 2022 +0200

    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 <jl...@mail.com>
    Reviewed-by: Kohei Yoshida <ko...@libreoffice.org>
    (cherry picked from commit f413eb0b43fa36edf69909f3821dfe6a54e3edf7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134363
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

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();

Reply via email to