sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |    1 +
 sw/source/core/text/txtfld.cxx             |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3b7ffa204c6d04640b5e2f4d4c6b6b4a03fd26c8
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Thu Apr 18 04:00:05 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Sat Apr 20 00:18:17 2024 +0200

    tdf#140616 ApplyParagraphMarkFormatToNumbering: including highlight
    
    I was concerned that I might override highlights
    set in numbering.xml but in that case
        pFormat && pFormat->hasItem(RES_CHRATR_HIGHLIGHT)
    so pCleanSet no longer hasItem.
    (see num3n.docx and TestDoc_highlight2.docx)
    Note: must use Word 2010+ to see numbering.xml highlights!!
    
    This is strictly a visual thing. Unit testing has traditionally
    used magic tile rendering x,y positions to check the color,
    which seems completely untrustworthy.
    
    Change-Id: I026252f127107e4782d08f72bfd5e2a412142111
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166303
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 6528b093fd57..ba70a335ca09 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -965,6 +965,7 @@ CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering)
 
     xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml");
     assertXPath(pXmlStyles, 
"//w:style[@w:styleId='CustomParaStyleHighlightGreen']/w:rPr/w:highlight"_ostr, 
"val"_ostr, "green");
+    // Visually, the last bullet point's text should be green-highlighted (but 
the bullet point itself shouldn't)
 
     if (bWasExportToShade)
     {
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 84f32e30971f..55e439096f3d 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -409,7 +409,7 @@ static void 
checkApplyParagraphMarkFormatToNumbering(SwFont* pNumFnt, SwTextForm
 
     if (oFontBackColor)
         pNumFnt->SetBackColor(oFontBackColor);
-    if (aHighlight != COL_TRANSPARENT)
+    if (aHighlight != COL_TRANSPARENT && 
!pCleanedSet->HasItem(RES_CHRATR_HIGHLIGHT))
         pNumFnt->SetHighlightColor(aHighlight);
 }
 

Reply via email to