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

See Also:
Crash report or crash signature:

Example file (9.05 KB, application/vnd.oasis.opendocument.text)
2020-08-14 20:31 UTC, Telesto
Comparison screenshot (ODT vs DOCX in 7.1) (130.89 KB, image/png)
2020-08-31 07:03 UTC, Aron Budea
135774_numberingHighlightShd2.docx: my working test document. (9.73 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-19 09:54 UTC, Justin L
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
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

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
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: (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 (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:
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):
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.,

As per ESC discussion, see
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
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
    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":


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:

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:shd w:fill="ED4C05" w:val="clear"/>

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.