Bug 69613 - FILESAVE: DOCX Export loses Table-of-Contents (ToC) flags
Summary: FILESAVE: DOCX Export loses Table-of-Contents (ToC) flags
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version: 4.2.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA target:4.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 15:11 UTC by Adam CloudOn
Modified: 2014-04-22 11:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


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

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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.