Created attachment 86266 [details] DOCX containing a Table-of-Contents Problem description: When LO opens the attached DOCX - it renders the Table-of-Contents pages wrong (e.g. - look at the last entry in the ToC - it says page '16' instead of page '15'). Steps to reproduce: 1. Load the attached DOCX in LO 2. The page numbers are rendered incorrectly 3. .... Current behavior: LO renders some of the page numbers in the ToC incorrectly Expected behavior: LO should render all the page numbers in the ToC like MS Word Operating System: All Version: 4.2.0.0.alpha0+ Master
It looks like you reported the bug twice. *** This bug has been marked as a duplicate of bug 69655 ***
(In reply to comment #1) > It looks like you reported the bug twice. > > *** This bug has been marked as a duplicate of bug 69655 *** Thomas. This is not a duplicate. Bug 69655 talks about the level of the Table-of-Contents, meaning - in the original file you have in the ToC - 'Heading 1', 'Heading 1.1' etc.. and in the exported file you only have the first level ('Heading 1', 'Heading 2', etc..) Bug 69649 talks about the actual page numbers in the ToC that are being imported wrong. In the original file the page number of the last entry is page #15, and in the file imported by LO - the page number of the last page is page #16. So these are 2 different import bugs (that both relate to Table-of-Contents).
*** Bug 72585 has been marked as a duplicate of this bug. ***
@Vinaya, Adam: please have a look to http://cgit.freedesktop.org/libreoffice/core/commit/?id=f65568118fc1ac71c22a3084e0a1bdd315a91006 It's cherry-picked from Apache OpenOffice. The commit-title looks very related to this bug, so you might consider have a look :-). Related AOO bug: https://issues.apache.org/ooo/show_bug.cgi?id=119568 Kind regards, Joren
Vinaya Mandke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9679e9c23216decb5f9f25f85b04cb3f25211111 fdo#69649 Fix for pre-rendered Table Of Contents 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.
@Jorendc, Adam This patch imports the TOC entries from the file itself. This also fixes bug 69655.
(In reply to comment #5) > Vinaya Mandke committed a patch related to this issue. (In reply to comment #6) > @Jorendc, Adam > This patch imports the TOC entries from the file itself. This also fixes > bug 69655. I can confirm this patch fixed this issue. Tested using Linux Mint 16 x64 with LibreOffice Version: 4.3.0.0.alpha0+ Build ID: 308fdfb1a9176f65c11d82b95e3aa73b87e2fe47 (which do include this patch). Thanks for your work :)! PS: can we backport this to 4.2-branch as well? Kind regards, Joren
@Joren, Sorry for the late reply. I think it might be possible. Though I have not checked building these changes on 4.2. Is there a way to check the same without building the 4.2 branch at my end ? Regards, Vinaya
(In reply to comment #8) > Is there a way to check the same > without building the 4.2 branch at my end ? Not sure about that. I guess you only can do that by building yourself, but it might be interesting to ask that on IRC to developers :-). Kind regards, Joren
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=018bbe6c538d99c2f14fd4c761048848dc458f4a fdo#69649 RTF import: don't crash on empty TOC result 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.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=64a72ee3e0e5818cd36e96f67ca7543e8a366969&h=libreoffice-4-2 fdo#69649 RTF import: don't crash on empty TOC result It will be available in LibreOffice 4.2.6. 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.
Unit test DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") was enhanced in order to remove usage of magic number. http://cgit.freedesktop.org/libreoffice/core/commit/?id=143c482b3189cb084fbdf5e6f78f15b43f099e24