Bug Hunting Session
Bug 121561 - Writer: DOCX export from ODT: TOC title is not recognized by MS Word
Summary: Writer: DOCX export from ODT: TOC title is not recognized by MS Word
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Serge Krot (CIB)
URL:
Whiteboard: target:6.3.0 target:6.2.1 target:6.1....
Keywords: filter:docx
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2018-11-20 18:07 UTC by Serge Krot (CIB)
Modified: 2019-05-09 09:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Krot (CIB) 2018-11-20 18:07:35 UTC
During export of the ODT file with TOC inside into DOCX format, the TOC title is being exported as regular paragraph. We should surround it with <w:sdt><w:sdtPr><w:sdtContent> to make it (TOC title) recognizable by MS Word as part of the TOC.

See test case: https://bugs.documentfoundation.org/attachment.cgi?id=146681
Comment 1 Serge Krot (CIB) 2018-11-22 20:12:03 UTC
https://gerrit.libreoffice.org/#/c/63786/
Comment 2 Commit Notification 2018-12-05 15:58:32 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/1575b46276a44fe0566fec8910188a781589dd75%5E%21

tdf#121561: sw: DOCX: add std/stdPr/stdContent around TOC

It will be available in 6.3.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 3 Xisco Faulí 2019-01-14 09:54:08 UTC
A polite ping to Serge Krot:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 4 Serge Krot (CIB) 2019-01-14 10:31:36 UTC
Resolved fixed in https://gerrit.libreoffice.org/#/c/63786/ for master.
Comment 5 Commit Notification 2019-01-15 18:02:45 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/1898bd6d5642ff81a09c2a9b6397ae145c3cfd8c%5E%21

tdf#121561: sw: DOCX: add std/stdPr/stdContent around TOC

It will be available in 6.2.1.

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 6 Timur 2019-01-16 11:48:20 UTC
When LO-saved DOCX is opened in MSO, previously ToC title was out of ToC.
Now title is inside ToC and we can change the style and have "Update Table...".

But "Update Table..." doesn't work properly.
If we do it in MSO on MSO created DOCX, we get dialog: Update page numbers only/Update entire table.
If we do it in MSO on LO created DOCX (using attachment), ToC title gets separated from ToC contents. Next click giver error "There's no ToC.."

Please check.
Comment 7 Serge Krot (CIB) 2019-01-16 13:10:22 UTC
Yes, I agreed.

The problem comes from that fact that latest paragraph of the TOC field (where field-end keyword is placed) was exported outside the STD frame. Fixing thin, will make correct behavior with MSO and LO.
Comment 8 Timur 2019-01-17 08:38:24 UTC
Thanks for clarification. 
Shall we reopen this one if you intend to solve it, or open a new bug?
Comment 9 Commit Notification 2019-01-21 12:15:58 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/fd5599b9d23a2d9b13af6dd88bd2d38f438f7e00%5E%21

tdf#121561 sw DOCX: output toc-end inside last toc paragraph

It will be available in 6.3.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 2019-01-24 08:42:20 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/e65b94e64315e2ead72679010c73561f79247002%5E%21

tdf#121561 sw DOCX: output toc-end inside last toc paragraph

It will be available in 6.2.1.

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 2019-01-24 08:43:43 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/05a5037f489971676737808c37ad1cfb9dcd53d9%5E%21

tdf#121561 sw DOCX: output toc-end inside last toc paragraph

It will be available in 6.1.6.

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 Timur 2019-01-24 15:39:27 UTC
Very nice to solve such a long standing bug and backport all.
Comment 13 Commit Notification 2019-01-28 12:27:29 UTC
Serge Krot committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-5":

https://git.libreoffice.org/core/+/a3ee3432dc7f9db2cec62daccc76f5e89dfe9459%5E%21

tdf#121561 sw DOCX: output toc-end inside last toc paragraph

It will be available in 6.1.5.

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.