diff options
author | Justin Luth <justin.luth@collabora.com> | 2021-03-13 09:45:27 +0200 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2021-03-13 12:00:31 +0100 |
commit | cb7839169ac58bc24d986f4cf5532d1d6219574d (patch) | |
tree | 36bf6cd63e829149a307b42f9a97625717b41bf0 /sw | |
parent | a9bdb74c0309fca470abdaabbddea84798cbaa83 (diff) |
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_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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 ) |