While editing document local hyperlinks, the "Target in document" window appears if browse button is pressed for target. This shows a list of headings, among other things. This list of headings is flat in the sense that all levels of headings are shown in a single list like manner, with the heading's outline numbers prefixed. This should be changed into a hierarchical tree like widget, such as in navigator, so that it can be navigated properly when there are many levels of headings in the document.
Additionally, also available in navigator, there should be a way to change verbosity level of heading list. Such as upto which level the headings are shown.
Steps to Reproduce:
1. Create a document with many levels of headings
2. Right click on a hyperlink, select "Edit hyperlink..."
3. In the edit dialog, go to "Document" tab
4. Press the browse button beside "Target in Document" > "Target" textbox
5. A "Target in document" dialog opens with a flat list of headings in the document"
A flat list of headings is shown in "Target in document" dialog. There is no option to control the level of displayed headings.
A hierarchical heading tree should be shown like navigator. There should be a way to control the level of headings displayed in that dialog
User Profile Reset: No
This is problematic for documents with many levels of headings, especially a particular level is more crowded that others, because then other levels are lost in the list; it's very hard to cherry-pick them from within.
This happened to me while numbering source code listing lines with the help of chapter numbering(so that it automatically restarts on each listing), but then it creates a heading out of each source code line and other levels are lost in them.
Build ID: 5.4.3-2
CPU threads: 2; OS: Linux 4.13; UI render: default; VCL: gtk3;
Locale: en-IN (en_IN.UTF-8); Calc: group
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Created attachment 139243 [details]
file for test
This requires significant changes in the code to determine the level of the heading.
String of menu bar for translation:
Files where the tree is made:
I attach the file for test this issue.
Created attachment 169146 [details]
Hyperlink Target in Document Headings expand collapse
Here is a link to a patch that does this:
Continued effort is needed to preserve the tree state when the tree is refreshed.
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":
tdf#114567 tdf#138934 Hyperlink-Target in Doc Headings expand/collapse
It will be available in 7.2.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:
Affected users are encouraged to test the fix and report feedback.
Version: 126.96.36.199.alpha0+ (x64) / LibreOffice Community
Build ID: 21c602913d98ef46b49fc9b6f9071db92a1597c6
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Jim, thanks for fixing it!