https://bugs.documentfoundation.org/show_bug.cgi?id=158279
Bug ID: 158279
Summary: TOC links lost when converting .doc to HTML
Product: LibreOffice
Version: 7.6.1.2 release
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
Description:
I have a .doc file with a table of contents with navigable links in
Word.(attached TOC_not_working_in_HTML.doc).
This file has 2 sections and a TOC which links to them. If you open it in Word,
you can navigate using TOC links to each section.
I generated the .html file using some macro: "soffice –headless
TOC_not_working_in_HTML.doc
“macro:///Batch_Conversions.Module1.UpdateAllAndConvertToHTML(html)"
The macro basically opens the document with LO, updates all and saves the file
converting it with the filter “HTML (StarWriter)”.
If instead of using the macro I convert it with (soffice --headless
--convert-to "html:HTML (StarWriter)" TOC_not_working_in_HTML.doc), the .html
TOC directly is a plain text without links to anything.
Here is the macro pseudo code:
Sub UpdateAllAndConvertToHTML( Optional Output_Format As String )
dim Filter(0) as new com.sun.star.beans.PropertyValue
Filter(0).Name = "FilterName"
Filter(0).Value = "HTML (StarWriter)"
UpdateAllAndKeepFileOpen
CurFileName= ThisComponent.getLocation()
NewFileName=Left( CurFileName, Len( CurFileName ) - 4 ) + ".html"
ThisComponent.storeToURL( NewFileName, Filter() )
ThisComponent.Close ( True )
End Sub
Sub UpdateAllAndKeepFileOpen
{
…
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:SelectAll", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:UpdateAll", "", 0, Array())
…}
End Sub
As you can see, the TOC_not_working_in_HTML_LO_7_BAD.html TOC is not working.
The reference from the TOC don’t get you to the different sections.
The LO version used in this case was: LibreOffice 7.6.1.1
If I use the older version (LibreOffice 6.0.7.3), the resulting html TOC works
(see TOC_not_working_in_HTML_LO_6_GOOD.html file).
Steps to Reproduce:
1. Convert to html with LibreOffice the .doc example file using a similar macro
or the convert-to command directly
Actual Results:
The TOC in resulting html file is not working in LO version 7.6.1.1
Expected Results:
In older version (6.0.7.3) doing the same procedures, the TOC is working in
HTML file.
Reproducible: Always
User Profile Reset: No
Additional Info:
Version: 7.6.1.1 (X86_64) / LibreOffice Community
Build ID: c7cda394c5de06de37d8109c310df89a4d4c3a98
CPU threads: 24; OS: Linux 3.10; UI render: default; VCL: gtk3
Locale: en-US (C); UI: en-US
Calc: threaded
--
You are receiving this mail because:
You are the assignee for the bug.