Bug 138345 - FILESAVE MS formats: Must not save char background as highlight in char styles. Only MS WORD problem
Summary: FILESAVE MS formats: Must not save char background as highlight in char style...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0
Keywords: bibisected, bisected, regression
: 99023 (view as bug list)
Depends on:
Blocks: Highlight-Color
  Show dependency treegraph
 
Reported: 2020-11-19 15:08 UTC by Justin L
Modified: 2022-03-27 07:02 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
charStyleBackground.odt: background colour not seen IN MS WORD when exported to DOCX etc. (12.99 KB, application/vnd.oasis.opendocument.text)
2020-11-19 15:08 UTC, Justin L
Details
charHighlight6.docx: testing various scenarios with highlight vs shade (9.65 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-11-23 07:04 UTC, Justin L
Details
charHighlight6-word2003.pdf: (Word 2016 looks the same as Word 2003.) (13.19 KB, application/pdf)
2020-11-23 07:05 UTC, Justin L
Details
paraShading.odt: focusing on paragraph-style settings this time (12.91 KB, application/vnd.oasis.opendocument.text)
2020-11-25 09:30 UTC, Justin L
Details
paraShading.pdf: how the LO6.4 export-as-highlight looks in Word 2016 (32.46 KB, application/pdf)
2020-11-25 09:32 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2020-11-19 15:08:55 UTC
Created attachment 167398 [details]
charStyleBackground.odt: background colour not seen IN MS WORD when exported to DOCX etc.

In this example, the character style charBackground defines an orange background. On export to MS formats, this background colour is kind-of lost. ONLY MISSING IN WORD. LO (incorrectly it appears) accepts the style's highlight specification and applies it - however, it is yellow instead of orange.

Although MS Word does not produce any errors, it silently ignores any w:highlight settings in Character styles. So LO character style highlighting should always save as "shading" instead of "highlighting".

In LO 5.0, a user setting was added to select whether character background should be saved as highlight or shading. It defaulted to highlighting - creating the bug reported here.

Starting in LO 7, the default is changed to shading, so most people won't encounter this problem any more. However, the possibility still exists for a user's settings to save as highlight, so it is still worthwhile to fix.

author	Zolnai Tamás on 2015-03-21 16:19:09 +0100
commit 8519d51b3a06a84d0d6418651e66e9bb534f1788 
Char highlight: export character background to MSO formats based on settings

Tested using Word 2016 and Word 2003.  Tested DOC and DOCX formats.
Comment 1 Justin L 2020-11-19 19:38:32 UTC
I started documenting this interoperability conundrum at https://wiki.documentfoundation.org/Documentation/CharHighlight.

Proposed fixes so far:
https://gerrit.libreoffice.org/c/core/+/106182 tdf#138345 sw ms export: never export highlight to charstyle

https://gerrit.libreoffice.org/c/core/+/106183 related tdf#138345 docx: don't import highlight into charstyle
Comment 2 Justin L 2020-11-21 19:01:46 UTC
(In reply to Justin L from comment #1)
> I started documenting this interoperability conundrum at
> https://wiki.documentfoundation.org/Documentation/CharHighlight.

Telesto - this was done for you. :-)
Comment 3 Telesto 2020-11-21 22:39:03 UTC
(In reply to Justin L from comment #2)
> (In reply to Justin L from comment #1)
> > I started documenting this interoperability conundrum at
> > https://wiki.documentfoundation.org/Documentation/CharHighlight.
> 
> Telesto - this was done for you. :-)

Ah, I wasn't aware! An interoperability conundrum wiki surely practical; Many thanks!
Comment 4 Justin L 2020-11-23 07:04:41 UTC
Created attachment 167494 [details]
charHighlight6.docx: testing various scenarios with highlight vs shade
Comment 5 Justin L 2020-11-23 07:05:34 UTC
Created attachment 167496 [details]
charHighlight6-word2003.pdf: (Word 2016 looks the same as Word 2003.)
Comment 6 Justin L 2020-11-25 09:30:39 UTC
Created attachment 167554 [details]
paraShading.odt: focusing on paragraph-style settings this time

I'm expanding this bug report a bit to include paragraph style as well.

NOTE: the user setting to export as highlight or shading is not concerned about imported files (those should round-trip as imported), but about changes made by LO users. So I'm attaching a simple ODT file.

MS Word doesn't seem to have any tool to adjust the shading (or highlight) in a paragraph style. So in this regard it doesn't really matter as much whether we chose to export as highlight or shade.

The only reason to export a paragraph charBackground as a highlight is so that MSWord's direct no-highlighting could cancel it.

But there are several reasons why it is better to export all styles as shading:
-LO can design with character styles (which override the paragraph style), but MSWord's character styles cannot contain highlighting. So any LO design using character styles will completely break.
-if a "none" is exported as a highlight, it won't override a char-style shading, but if the paragraph AND none are exported as shading, then all cases work. There is NEVER A NEED to export none as highlight if all styles export as shading. (Unless perhaps document defaults or something insane like that...)
-there is no reduction to 15 colours in that case for any style charBackgrounds.
-currently a "none" is not exported as a highlight anyway. So there is no way that this will make the current situation worse.
Comment 7 Justin L 2020-11-25 09:32:46 UTC
Created attachment 167555 [details]
paraShading.pdf: how the LO6.4 export-as-highlight looks in Word 2016
Comment 8 Justin L 2020-11-25 13:28:42 UTC
Proposed fix for paragraph style: https://gerrit.libreoffice.org/c/core/+/106587
Comment 9 Commit Notification 2020-11-27 11:15:53 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5951a867b87cbb88886968c1e2059f2cf461d11c

tdf#138345 sw ms export: Char highlight: no export to char-style

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.
Comment 10 Commit Notification 2020-12-02 11:14:54 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/20574b4023952c8fbfa728590f3bdcf603633cca

tdf#138345 ms formats Char highlight: no import into char-style

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.
Comment 11 Commit Notification 2021-02-27 14:34:52 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f370f7be397af54bf56fd7a6703aae4c38113234

tdf#138345 Char highlight: numbering needs charstyle props highlight

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.
Comment 12 Justin L 2021-03-17 09:28:20 UTC
*** Bug 99023 has been marked as a duplicate of this bug. ***