Bug 135774 - Formatting of the bulleted list lost after DOCX export
Summary: Formatting of the bulleted list lost after DOCX export
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on: 134619
Blocks: DOCX-Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2020-08-14 20:31 UTC by Telesto
Modified: 2021-03-15 10:22 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (9.05 KB, application/vnd.oasis.opendocument.text)
2020-08-14 20:31 UTC, Telesto
Details
Comparison screenshot (ODT vs DOCX in 7.1) (130.89 KB, image/png)
2020-08-31 07:03 UTC, Aron Budea
Details
135774_numberingHighlightShd2.docx: my working test document. (9.73 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-19 09:54 UTC, Justin L
Details
ddd1RT.docx: Word DOES use the w:shd from numbering.xml (5.32 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-26 10:14 UTC, Justin L
Details
ddd1_highlight.docx: This uses highlight instead of shd in numbering.xml (5.62 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-27 12:21 UTC, Justin L
Details
Test DocRT.docx: This test shows why the upcoming mxBackColor patch is so important - some bullets where missing the yellow background. (5.40 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-03-11 10:35 UTC, Justin L
Details
TestDoc_highlight2.docx: bullets are all green highlight (6.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-03-13 07:30 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-08-14 20:31:14 UTC
Description:
Formatting of the bulleted list lost after DOCX /RTF export

Steps to Reproduce:
1. Open the attached file
2. Save as DOCX
3. File reload

Actual Results:
Notice highlighting being the same color 
Notice bullet color being gone

Expected Results:
Bullet color being present
Highlighting/shading color being present


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

it worked more or less in
6.4 (expect color being off

else it's long road back.. with various issues in highlighting. It was working properly in 4.2
Comment 1 Telesto 2020-08-14 20:31:27 UTC
Created attachment 164323 [details]
Example file
Comment 2 Aron Budea 2020-08-31 07:02:47 UTC
Confirmed using LO 7.1.0.0.alpha0+ (217122387f6e0ef657b8ba85eae082b448901cec) / Ubuntu.

(In reply to Telesto from comment #0)
> Expected Results:
> Bullet color being present
This is bug 134619.

> Highlighting/shading color being present
This started with the following commit:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=701238ea7d8a06fe7a90de15b7660b7c6d854f09
author		Tamás Zolnai <tamas.zolnai@collabora.com>	2020-03-23 12:34:16 +0100
committer	Tamás Zolnai <tamas.zolnai@collabora.com>	2020-03-23 13:34:25 +0100

"tdf#125268: Export LO character background as MSO shading by default."

The change in 4.3 (bullet color changed to black) started in the following range, likely by one of Jacobo's commits (can't pinpoint the exact commit due to crashes):
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=8233226fe4614d5cebe474a0d1b026084e023e4c..291e846db9840b9f82bc28e495b54ae5ac51d0fc
Comment 3 Aron Budea 2020-08-31 07:03:47 UTC
Created attachment 164904 [details]
Comparison screenshot (ODT vs DOCX in 7.1)
Comment 4 Justin L 2020-11-24 05:27:36 UTC
Bibisecters - please make a mental note to remember this - which will be a very common complaint in the next few years.

The correct bibisect for comment 2 comes from https://bugs.documentfoundation.org/show_bug.cgi?id=125268#c56

commit	a4c5e940881520834c19573c5b1119afa1c17744
author	Miklos Vajna on Fri Apr 03 10:44:46 2020 +0200

tdf#125268 officecfg: export LO character background as MSO shading by default

This restores commit 701238ea7d8a06fe7a90de15b7660b7c6d854f09
(tdf#125268: Export LO character background as MSO shading by default.,
2020-03-23).

As per ESC discussion, see
<https://lists.freedesktop.org/archives/libreoffice/2020-April/084813.html>
for the details. Summary: the benefit is that this way we don't loose
data, and the cost is that LO's highlighting is called shading in MSO
now.
Comment 5 Justin L 2021-01-27 11:49:07 UTC
Back in LO 6.0, it looked similar to today - where almost everything was a single background colour. Then in 6.1, it looked more like the original ODT (albeit scaled to the 15 available highlight colours) because of
author	Tamás Zolnai on 2018-01-10 05:59:14 +0100
https://cgit.freedesktop.org/libreoffice/core/commit/?id=aa02ed306f7c633bbffede16e44e8e736977ace4
    tdf#106991: Highlighting remains after select no fill


Using the bibisect-linux-64-6.4 is very interesting, because it includes commits that are backported. In here, we can see that the bullets lost their colour completely - both the font colour and the background highlight. This is the same bug 134619 that comment 2 identified for the lost font-colour of the bullet in 7.0 and backported to 6.4.5.
author	Vasily Melenchuk on 2020-05-14 21:52:44 +0200
commit	ec43d70911736b821e527109fadb3537635091de
    tdf#132766: DOCX export: always try to set bullet font for list

So this fix is going to depend on bug 134619 to be fixed first.

I know that highlighting wasn't importing or exporting NONE properties, so I'm guessing that the 6.1 commit was a bit of a hack to work around that. Today a NONE should be imported and exported - and using "highlighting" instead of "shading" is now buried away were no one will find it. So we can probably just revert that 6.1 hack. But this is all speculation at this point.
Comment 6 Justin L 2021-02-19 09:54:13 UTC
Created attachment 169895 [details]
135774_numberingHighlightShd2.docx: my working test document.

Proposed fix at http://gerrit.libreoffice.org/c/core/+/111201 tdf#114799 Char highlight: apply to numbering
Comment 7 Commit Notification 2021-02-23 05:14:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/873df086db969cadc66087a5abdb1ff33f2c99f1

tdf#135774, tdf#114799 Char highlight: apply to numbering

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 8 Justin L 2021-02-23 08:17:40 UTC
IMPORTANT: Any fix here needs to be compared with how MS Word sees the document.

The only way that numbering can have a background is if it is exported as w:highlight. By default, LO (since 7.0) exports that as w:shd. So, generally the bullet colour is going to be gone. That is probably a good thing, because highlight only allows 16 colours, so a blank numbering probably looks better than a different colour.

So, this example document that starts from ODT is basically an impossible-in-docx request. I'll leave it open for now as I struggle with other aspects of w:highlight, and see what might be possible later on.
Comment 9 Justin L 2021-02-23 11:30:33 UTC Comment hidden (no-value)
Comment 10 Telesto 2021-02-23 14:10:43 UTC Comment hidden (no-value)
Comment 11 Justin L 2021-02-23 15:21:43 UTC Comment hidden (no-value)
Comment 12 Telesto 2021-02-23 15:53:51 UTC Comment hidden (no-value)
Comment 13 Justin L 2021-02-26 10:14:01 UTC
Created attachment 170075 [details]
ddd1RT.docx: Word DOES use the w:shd from numbering.xml

The bullet points should have a reddish orange background because of numbering.xml 
<w:lvl w:ilvl="1">
  <w:rPr>
    <w:shd w:fill="ED4C05" w:val="clear"/>
  </w:rPr>
</w:lvl>

This worked until 5.0's author	Luboš Luňák on 2014-05-29 14:34:50 +0200
commit	df07d6cb9f62c0a2c4b29bd850d4efb4fcd4790b
handle direct formatting for numbering in .docx (bnc#875717)


This is just a very nasty area to work in. A lot of the smartest, most experienced people have been involved. I guess shading and highlighting are very edge cases in this saga.
Comment 14 Telesto 2021-02-26 10:29:36 UTC Comment hidden (no-value)
Comment 15 Justin L 2021-02-27 12:21:24 UTC
Created attachment 170110 [details]
ddd1_highlight.docx: This uses highlight instead of shd in numbering.xml

Temporarily broken in 7.2:
author	Justin Luth on 2020-12-02 12:13:48 +0100
commit	20574b4023952c8fbfa728590f3bdcf603633cca
tdf#138345 ms formats Char highlight: no import into char-style
Comment 16 Justin L 2021-03-02 15:19:56 UTC
(In reply to Justin L from comment #5)
> I'm guessing that the 6.1 commit was a bit of a hack to work around that.
> So we can probably just revert that 6.1 hack.
That was done by Laszlo in 7.0 in bug 127606.
Comment 17 Commit Notification 2021-03-06 11:17:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/43436ef43132eb3ee6c10c0fe50971062677682a

tdf#135774 writerfilter Char highlight: revert tdf#117137

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 18 Justin L 2021-03-11 10:35:32 UTC
Created attachment 170407 [details]
Test DocRT.docx: This test shows why the upcoming mxBackColor patch is so important -  some bullets where missing the yellow background.
Comment 19 Commit Notification 2021-03-12 19:11:13 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135774 Char highlight: numbering: don't clear existing mxBackColor

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 20 Justin L 2021-03-13 07:30:23 UTC
Created attachment 170451 [details]
TestDoc_highlight2.docx: bullets are all green highlight

A modified version of comment 18 shows why the next "save highlight" patch is needed.
Comment 21 Commit Notification 2021-03-13 11:01:34 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135774 Char highlight: partial revert tdf#114799

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 22 Justin L 2021-03-15 06:01:30 UTC
I removed RTF format from the subject/bug report since in general it doesn't work well with styles and numbering. So it is very different from DOCX, and is really a separate bug.

This bug should now be fixed.
Comment 23 sdc.blanco 2021-03-15 10:22:41 UTC
(In reply to Justin L from comment #22)
> I removed RTF format from the subject/bug report since in general it doesn't
> work well with styles and numbering. So it is very different from DOCX, and
> is really a separate bug.
For RTF version: see bug 137591