Description: The No fill setting seems to not be taken into account with the following docx (it was generated from WPS office). The expected behavior is to have white text on a purple background. In libreoffice, the text is white and with a white highlight, making the text unreadable. Steps to Reproduce: Open the attachment Actual Results: The text is white with a white highlight Expected Results: The text should be white on a purple background Reproducible: Always User Profile Reset: No Additional Info: $ libreoffice6.4 --version LibreOffice 6.4.6.2 0ce51a4fd21bff07a5c061082cc82c5ed232f115
Created attachment 166633 [details] Docx file that triggers the issue.
This seems to be related to this : https://bugs.documentfoundation.org/show_bug.cgi?id=91292
I've just tried to open the same document with libreoffice 7.0 and I see the same bug.
Created attachment 166634 [details] Expected Rendering
Created attachment 166635 [details] Actual rendering on libreoffice 6.4.6.2
I confirm it with Version: 7.0.2.2 (x64) Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: he-IL (de_DE); UI: en-GB Calc: threaded Steps to reproduce 1. Open attacment from comment 1 2. Change text highlight from white to no fill. 3. Save as docx 4. Reopen Actual result: Text is again highlighted in white.
Be warned: any work done here is DANGEROUS!!! See bug 125268. The relevant parts from document.xml should be these. <w:tc> <w:tcPr> <w:shd w:val="clear" w:color="auto" w:fill="7C26FF"/> </w:tcPr> <w:p> <w:pPr> <w:rPr> <w:color w:val="FFFFFF" w:themeColor="background1"/> <w:highlight w:val="none"/> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:color w:val="FFFFFF" w:themeColor="background1"/> <w:highlight w:val="none"/> </w:rPr> <w:t>ABC</w:t> </w:r> </w:p> </w:tc> It looks like we don't handle LN_Value_ST_HighlightColor_none in DomainMapper.cxx, nor do we export COL_AUTO in docx/doc/rtf. This issue will need some research, because there seem to be two settings that configure the same thing. RES_CHRATR_HIGHLIGHT and RES_CHRATR_BACKGROUND. Is it safe to assume that LO has the same priority as DOCX? There is also a user setting option that supposedly defines whether to export as background or highlight. It probably needs some fixing too. The initial commits to make the distinction and user setting can be found at https://cgit.freedesktop.org/libreoffice/core/log/?qt=grep&q=Char+highlight%3A and it all starts with https://cgit.freedesktop.org/libreoffice/core/commit/?id=8b949134441056a1455d67ddfdd7e0bc5f2ee682 MS Documentation for DOCX: 17.3.2.15 (Text Highlighting) This element specifies a highlighting color which is applied as a background behind the contents of this run. If this run has any background shading specified using the shd element (ยง17.3.2.32), then the background shading shall be superseded by the highlighting color when the contents of this run are displayed. If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then text highlighting shall not be applied to the contents of this run. Required reading is http://zolnaitamas.blogspot.com/2015/03/word-compatible-text-highlighting-in.html
The definitive bug report to look at might be bug 64490. I have started an information gathering wiki page for char highlighting at https://wiki.documentfoundation.org/Documentation/CharHighlight. The root of the problem for this report is that the default para-style defines a white colour highlight, which needs to be cancelled everywhere. Unbelievable. <w:style w:type="paragraph" w:default="1" w:styleId="1"> <w:name w:val="Normal"/> <w:rPr> <w:highlight w:val="white"/> This means we need to import AND export none highlighting. Great.
Patches that get us there are: -http://gerrit.libreoffice.org/c/core/+/106314 tdf#137683 writerfilter Char highlight: import "none" -http://gerrit.libreoffice.org/c/core/+/106315 tdf#137683 DOCX/RTF Char highlight: export "none" -http://gerrit.libreoffice.org/c/core/+/106316 tdf#137683 DOC: Char highlight: export "none" However, it will probably be a while before I propose them - since I don't want to spam unnecessary w:highlight w:val="none" entries, and I don't know how to avoid that yet.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/81ecdd52ef2f3d390327a0bf6b6fa906805843f7 tdf#137683 writerfilter Char highlight: import "none" It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2622cd9c31a5db423c6f878f990a41191d0079af tdf#137683 sw ms formats Char highlight: export "none" It will be available in 7.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
VERIFIED FIXED with Version: 7.2.0.0.alpha0+ (x64) Build ID: 9f9798f07f0b56ae474f31ded671cc8da598d244 CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: threaded