sw/source/core/text/txtfld.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit cb7839169ac58bc24d986f4cf5532d1d6219574d
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Sat Mar 13 09:45:27 2021 +0200
Commit:     Justin Luth <justin_l...@sil.org>
CommitDate: Sat Mar 13 12:00:31 2021 +0100

    tdf#135774 Char highlight: partial revert tdf#114799
    
    ...DOCX import: fix missing numbering highlight
    from 7.0 commit 315d56582f8a56d8f2d3ea6cda63ea4832249608.
    
    If the numbering had a specified w:highlight in numbering.xml,
    then that character background should apply to the bullet point.
    
    However, SetDiffFnt automatically clears the highlight,
    the same as it does with mxBackColor (fixed in earlier commit).
    So a special step is needed to check if the font has a highlight,
    and since that direct formatting has priority, re-apply it
    after SetDiffFnt has finished.
    
    This is slightly different from mxBackColor - which is an
    optional attribute. Highlight is reset to COL_TRANSPARENT.
    If a RES_CHRATR_HIGHLIGHT exists explicitly setting a
    COL_TRANSPARENT, then any overrides should have been removed from
    pCleanedSet, and so it never needs to SetHighlightColor(AUTO).
    
    Change-Id: Id9d88054254563706b9aee90a1d257b467139334
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112410
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_l...@sil.org>

diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 3d1bd5845bce..e889ada8d8d4 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -525,11 +525,15 @@ static void 
checkApplyParagraphMarkFormatToNumbering(SwFont* pNumFnt, SwTextForm
     // SetDiffFnt resets the background color (why?), so capture it and 
re-apply if it had a value,
     // because an existing value should override anything inherited from the 
paragraph marker.
     const std::optional<Color> oFontBackColor = pNumFnt->GetBackColor();
+    // The same is true for the highlight color.
+    const Color aHighlight = pNumFnt->GetHighlightColor();
 
     pNumFnt->SetDiffFnt(pCleanedSet.get(), pIDSA);
 
     if (oFontBackColor)
         pNumFnt->SetBackColor(oFontBackColor);
+    if (aHighlight != COL_TRANSPARENT)
+        pNumFnt->SetHighlightColor(aHighlight);
 }
 
 static const SwRangeRedline* lcl_GetRedlineAtNodeInsertionOrDeletion( const 
SwTextNode& rTextNode )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to