Created attachment 133151 [details] LibreOffice_screencast_of_export_to_XHTML_heading_style_numbering_problem.gif Hi, using the following LibreOffice on Windows 7: ====================== Version: 5.3.2.2 Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1 CPU Threads: 3; OS Version: Windows 6.1; UI Render: default; Layout Engine: new; Locale: sl-SI (sl_SI); Calc: group ====================== 1. I renamed profile to make sure this is not my environment special problem related to profile. 2. I created two lines of text and both of them created with "Heading 1" style. 3. Created Insert | Page Break (probably cause of the problem). 4. Created Table of Content. 5. LibreOffice works fine. First heading is numbered "1 First heading" and second heading is correctly numbered "2 Second headign". Now export content of LibreOffice Writer document to XHTML. 6. Now look into browser and there is correct numbering for "1 First heading", but wrong numbering with "3 Second heading". 7. If going back to LibreOffice we can see under the Table of Content it is new line with "Heading 1" style that has zero effect in LibreOffice document, but when exported to XHTML then it has effect on numbering. 8. Changing this dummy line style from "Heading 1" style to "Default" style and re-exporting the file and problem is fixed. It looks like export to XHTML has some bug when exporting. I have recorded the screencast (gif file video). Open the file in gif viewer like web browser to see the screencast. If you will open file in Firefox I suggest to press F11 to display browser in full screen mode. ADDITIONAL TEST (not seen on screencast) - EXPORT TO PDF 1. Set in dummy line style back to "Heading 1". 2. Export to PDF and numbering of "2 Second heading" is correct. This indicate that source of the problem may be the XHTML export. Thanks
Hi, I have found out another simpler way to reproduce a problem without Table of Content, just free lines of text and "Heading 1" styles. It looks export to XHTML has some problems with unnumbered heading styles. See screencast for details. Regards
Created attachment 133155 [details] Second_simplified_sample_screencast.gif
On pc Debian x86-64 with master sources updated some days ago, I could reproduce this. I made some tests and found that a slight change made work your second example. The problem is I don't know xsl and am not sure. Would you have some time to give a try after changing instdir/share/xslt/export/xhtml/body.xsl ? (in your LO directory profile, see https://wiki.documentfoundation.org/UserProfile#Windows) Line 1424, change this line: <xsl:with-param name="i" select="$i + 1"/> into <xsl:with-param name="i" select="$i + 2"/>
Hi, I have changed the setting 1 to 2 in body.xls file as suggested in your reply and it looks this solves the problem. I have recorded screencast with this solution. I have also tested PDF export and see it has zero effect on it (as expected). I suggest to apply this fix to LibreOffice source code (if there is no other side effect). I hate to have some special setting in my installation files that are different then all other installations on the world. If some problem appers I will forget about this special settings and it would be almost impossible to diagnose the problem. Regards
Created attachment 133159 [details] Solution_1_change_install_body_xsl_config_file.gif
I submitted the patch for review here: https://gerrit.libreoffice.org/#/c/37391
Created attachment 133166 [details] usual numbering without removing numbers The attached file has a usual numbering, here 1 2 3 4 4.1 4.2 5 5.1 5.2. With your change applied it exports to 1 2 2 3 2.1 2.2 3 3.1 3.3 So totally broken. The reason of the wrong numbering is different. When the number is removed by delete, this is reflected in the ODF source by the attribute text:is-list-header="true". But that attribute is not evaluated for pure headings by the XSLT, but only for lists.
Sorry, I don't understand xsl/xpath logic. I'm quite sure someone who knows a minimum about this, will do this in less than 1 minute with Regina's comment.
I spent more time to understand and so give a new try with: https://gerrit.libreoffice.org/#/c/37655/ It works with example of reporter+Regina's example.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d67747c59c22e0346e13560810b9f3bf6c698428 tdf#107696: fix exports Heading style numbers It will be available in 5.4.0. 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.
Created attachment 133364 [details] Header without number on level 2 Continuing of numbers is correct with the patch; but the header, where the number is removed, still gets a number in xhtml. But there are two more bugs with chapter numbering: (1) There are always the numbering of all levels shown, although the text document has set to only show the inner one level. (2) The type of number is taken from the inner level. But in the text document each lever has its own type.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=296c2296f5565556eea9fab51563050f28bbcafc Related tdf#107696: deal with non empty header without number It will be available in 5.4.0. 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.
(In reply to Regina Henschel from comment #11) > Created attachment 133364 [details] > Header without number on level 2 > > Continuing of numbers is correct with the patch; but the header, where the > number is removed, still gets a number in xhtml. > > But there are two more bugs with chapter numbering: > (1) There are always the numbering of all levels shown, although the text > document has set to only show the inner one level. > (2) The type of number is taken from the inner level. But in the text > document each lever has its own type. As you may have seen, I submitted a new patch to deal with your last attachment. To test more quickly, could you attach an example for your 2 other bugs?
Created attachment 133366 [details] Numbering with 1 "number" on all levels The attached file has A heading 1 subheading (a) subsubheading That works better with lists. Perhaps you can take some ideas from that section?
Created attachment 133367 [details] Same kind of numbering, but for lists
Regina: I think we should test if style of the header contains style:default-outline-level and depending on this value, adding the last prefix digit/alpha only or the whole hierarchy. Anyway, I don't think I could achieve this so prefer unassign myself on this. Now, I don't know if 1) we should backport the 2 patches on 5.3 branch 2) do you prefer we let this bugtracker opened or do you prefer close this one and open a brand new one
Julien: Wrong handling of "show sublevel" is now in bug 107940. Wrong handling of different styles on levels is now in bug 107941. We can keep this for the problems related to unnumbered heading because of attribute text:is-list-header="true". The two patches solve the problem of the unnumbered heading, so why not backport them to the 5.3 branch? If someone provides a solution to the entire "numbered heading" problems, it can then be changed where necessary.
Regina: Thank you for your feedback. I submitted the 2 patches for backport in 5.3 https://gerrit.libreoffice.org/#/c/37661/ https://gerrit.libreoffice.org/#/c/37792/ Let's put this one to FIXED then.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-5-3": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9b4c1e9d85445f4ddfb45359ad661d4826fe6a3c&h=libreoffice-5-3 tdf#107696: fix exports Heading style numbers It will be available in 5.3.4. 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.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-5-3": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6ee4771aff5d756f45014b88aebbcfb25b5cadfe&h=libreoffice-5-3 Related tdf#107696: deal with non empty header without number It will be available in 5.3.4. 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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/acedbb8692bc84c93114dc4d441b3eb20b3ac467 tdf#107696, tdf#111492: xhtml: Add unittest It will be available in 7.0.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.