Bug 69613 - FILESAVE: DOCX Export loses Table-of-Contents (ToC) flags
Summary: FILESAVE: DOCX Export loses Table-of-Contents (ToC) flags
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 15:11 UTC by Adam CloudOn
Modified: 2015-06-21 18:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX containing 'Table-of-Contents' (34.23 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-09-20 15:11 UTC, Adam CloudOn
Details
DOCX exported from LO that contains the ToC with the missing flags (8.65 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-09-20 15:43 UTC, Adam CloudOn
Details
Document with TOC without \f flag (15.33 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-12-19 09:18 UTC, Tushar Bende
Details
document with TOC with \f flag (15.33 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-12-19 09:19 UTC, Tushar Bende
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam CloudOn 2013-09-20 15:11:49 UTC
Created attachment 86186 [details]
DOCX containing 'Table-of-Contents'

Problem description: 
When loading a DOCX in LO that has a table-of-contents (ToC) in it - and exporting it back to DOCX - it loses some of the ToC's flags.
The flags in questions are:
'\h' - Inserts TOC entries as hyperlinks.
'\z' - Hides tab leader and page numbers in Web layout view.
'\u' - Builds a table of contents by using the applied paragraph outline level.

The flags info was from this page:
http://office.microsoft.com/en-001/word-help/field-codes-toc-table-of-contents-field-HP005186201.aspx

Steps to reproduce:
1. Load the attached DOCX in LO
2. Save as NEW.DOCX
3. Examine the NEW.DOCX's 'document.xml' file
4. Table-of-contents flags are missing

Current behavior:
LO should loses the table-of-contents flags

Expected behavior:
LO should preserve the table-of-contents flags
              
Note:
It would be nice to support *ALL* flags that 'ToC' might have, 
but this bug is about these 3 specific flags that are in the attached DOCX.
              
Operating System: All
Version: 4.2.0.0.alpha0+ Master
Comment 1 Adam CloudOn 2013-09-20 15:42:47 UTC
In addition,
the '\o' flag is not preserved.

From the link 
http://office.microsoft.com/en-001/word-help/field-codes-toc-table-of-contents-field-HP005186201.aspx

'\o' ==> Builds a table of contents from paragraphs formatted with built-in heading styles. For example, { TOC \o "1-3" } lists only headings formatted with the styles Heading 1 through Heading 3. If no heading range is specified, all heading levels used in the document are listed. Enclose the range numbers in quotation marks.
Comment 2 Adam CloudOn 2013-09-20 15:43:19 UTC
Created attachment 86195 [details]
DOCX exported from LO that contains the ToC with the missing flags
Comment 3 Jorendc 2013-10-03 21:11:56 UTC
New right away :).

@Adam: as known developer and expert on this domain you're allowed to mark your bugs as NEW right away :-). I know you're doing great job and have the knowledge. Also you're aware to not create dupes right away :).

Thanks for enhancing the compatibility of LibreOffice!

Kind regards,
Joren
Comment 4 Adam CloudOn 2013-10-10 09:59:34 UTC
(In reply to comment #3)
> @Adam: as known developer and expert on this domain you're allowed to mark
> your bugs as NEW right away :-). I know you're doing great job and have the
> knowledge. Also you're aware to not create dupes right away :).
> 
> Thanks for enhancing the compatibility of LibreOffice!

With there was a 'like' button here ... :-)
Comment 5 Tushar Bende 2013-12-19 09:18:58 UTC
Created attachment 90984 [details]
Document with TOC without \f flag
Comment 6 Tushar Bende 2013-12-19 09:19:29 UTC
Created attachment 90985 [details]
document with TOC with \f flag
Comment 7 Commit Notification 2014-01-10 16:02:23 UTC
PriyankaGaikwad committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b4e9e7726f0c67938e8b80e6b7c2883459d0b533

fdo#69613 DOCX export: Fix for '\o' flag field should export once.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2014-01-10 16:19:14 UTC
Tushar Bende committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9f9c2bb4d5907be5726f50cfd5dfa8ae1d251dcf

fdo#69613: Fix for DOCX Export loses Table-of-Contents flags



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2014-01-10 17:16:11 UTC
YogeshBharate committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ec5903ddb6165f0882aa1ffe4f3ff3e1c1127910

fdo#69613: Code changes for TOC with flag '\z' should get preserved after RT.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2014-01-13 13:47:28 UTC
YogeshBharate committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8e634d0d557bcad6bf56adb30d202e88675f17d1

fdo#69613: Code changes for TOC with flag '\w' should get preserved after RT.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2014-01-13 15:21:56 UTC
PriyankaGaikwad committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5b6a41f44663590a878abed3d857d762ab3c4895

fdo#69613:Fix for TOC field flag 'b' should preserved after RT.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2014-01-13 16:08:59 UTC
YogeshBharate committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dbd42432c7b8f8149080bb13b103b35f2532eee8

fdo#69613: Code changes for TOC with flag '\x' should get preserved after RT.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2014-01-20 08:25:42 UTC
Pallavi Jadhav committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=04a7ac6f062e9296eb643180cf54345bcdb260c4

fdo#69613 : Fix for TOC with flag '\u' should get preserved after RT.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 Jorendc 2014-04-21 23:31:56 UTC
@Adam: following the fixes: the only missing flag is '\h'?

Kind regards,
Joren
Comment 15 Adam CloudOn 2014-04-22 11:26:37 UTC
(In reply to comment #14)
> @Adam: following the fixes: the only missing flag is '\h'?
> 
> Kind regards,
> Joren

Following flags are still unsupported:
a, d, s, l, n, p
Comment 16 QA Administrators 2015-06-08 14:41:54 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

   Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.3 or later)
   https://www.libreoffice.org/download/

   If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
 
 If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

   Update the version field
   Reply via email (please reply directly on the bug tracker)
   Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug 
3. Leave a comment with your results;
4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-06-08
Comment 17 Buovjaga 2015-06-21 18:30:15 UTC
(In reply to Adam CloudOn from comment #15)
> (In reply to comment #14)
> > @Adam: following the fixes: the only missing flag is '\h'?
> > 
> > Kind regards,
> > Joren
> 
> Following flags are still unsupported:
> a, d, s, l, n, p

Original docx doesn't contain those flags and I confirm all the other tags mentioned in this report are now preserved in the document.xml.

Closing as fixed. Another report should be opened for those other tags with a document to test with.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 3ecef8cedb215e49237a11607197edc91639bfcd
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-06-19_23:16:58
Locale: fi-FI (fi_FI)