Bug 86395 - Allow sorting of bookmarks in the navigator in two ways: alphabetically and by order in document
Summary: Allow sorting of bookmarks in the navigator in two ways: alphabetically and b...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.0.alpha2
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:24.8.0 target:24....
Keywords:
: 147658 156202 (view as bug list)
Depends on:
Blocks: Navigator Bookmarks
  Show dependency treegraph
 
Reported: 2014-11-17 14:26 UTC by sophie
Modified: 2023-12-15 08:01 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
text file to test (15.60 KB, application/vnd.oasis.opendocument.text)
2014-11-17 16:02 UTC, Cor Nouws
Details
file with screenshots from two versions (231.34 KB, application/force-download)
2015-03-26 11:45 UTC, Cor Nouws
Details
Modification of the test case from above with some additional findings (60.05 KB, application/vnd.oasis.opendocument.text)
2019-06-16 16:21 UTC, Adalbert Hanßen
Details
bookmarks sort demo (398.17 KB, video/x-matroska)
2022-03-12 07:20 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sophie 2014-11-17 14:26:03 UTC
Hi, Steps to reproduce:
- add some text to a writer document (using AutoText td+F3 for example)
- put the cursor on the second line
- select Insert > Bookmark, give a name in the dialog that opens, press OK
- insert another bookmark two lines below using the same proces
- display the Navigator
==> the second bookmark is listed first while they are correctly listed in the Status bar (right click on the page number).
Version: 4.4.0.0.alpha2+
Build ID: 50ab596fa526244dbb3115029a5e87464b939305
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-11-17_01:42:28
Locale: fr_FR
while correct in Version: 4.3.2.1
Build ID: f9b3ad49d92181b0a1fe7e76f785a2c2cd0847d3
Sophie
Comment 1 Cor Nouws 2014-11-17 16:02:17 UTC
Created attachment 109631 [details]
text file to test

Hi sophie,

cannot reproduce on 4.4.0.alpha0 and 4.4.0.alpha2 ..
Comment 2 Cor Nouws 2014-11-17 16:02:38 UTC
(In reply to Cor Nouws from comment #1)

> cannot reproduce on 4.4.0.alpha0 and 4.4.0.alpha2 ..

Ubuntu 32 bits
Comment 3 Urmas 2014-11-18 06:46:18 UTC
They seem to be in the alphabetical order. What's wrong with that?
Comment 4 sophie 2014-11-18 13:36:55 UTC
(In reply to Urmas from comment #3)
> They seem to be in the alphabetical order. What's wrong with that?

Hi Urmas, yes, you're right, they are in alphabetic order. In previous versions they were in the same order as when inserted, like all the objects listed in the Navigator and like it's still in the Status bar. Sophie
Comment 5 raal 2015-02-25 21:30:50 UTC
(In reply to sophie from comment #4)
> (In reply to Urmas from comment #3)
> > They seem to be in the alphabetical order. What's wrong with that?
> 
> Hi Urmas, yes, you're right, they are in alphabetic order. In previous
> versions they were in the same order as when inserted, like all the objects
> listed in the Navigator and like it's still in the Status bar. Sophie

Tried with LO 3.5. I added bookmark "AA" into your file and in navigator is this bookmark on first position. The same behaviour as in LO 4.5
Comment 6 Buovjaga 2015-03-03 15:48:26 UTC
(In reply to sophie from comment #0)
> Hi, Steps to reproduce:
> - add some text to a writer document (using AutoText td+F3 for example)
> - put the cursor on the second line
> - select Insert > Bookmark, give a name in the dialog that opens, press OK
> - insert another bookmark two lines below using the same proces
> - display the Navigator
> ==> the second bookmark is listed first while they are correctly listed in

Did this from scratch in 3.5.0 and gave the name bb to the first inserted one and aa to the second. In the navigator aa is the first listed one.

Ubuntu 14.10 64-bit
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 7 Cor Nouws 2015-03-26 11:45:10 UTC
Created attachment 114372 [details]
file with screenshots from two versions

Attached PDF shows screenshots from 3.6.6.1 and 4.2.2.1
in both I created a document with various copied/inserted bookmarks

sort order in Navigator in different from that on the status bar, but the same in both versions.

Difference is (and that bit me this morning with some automation trick :( ) that copied bookmarks were nicely named in previous versions
 Previous: Copy A and B >> A1, B1, A2, B2
 Currently: Copy A and B >> A5, B6, A7, B8
which makes searching in many copied bookmarks (serial letters...) a night mare ..
Comment 8 sophie 2015-06-09 10:11:25 UTC
Tested it again today with Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: fr_FR
Bookmarks are sorted by alphabetic order in the Navigator while listed by order of insertion in the status bar. Sophie
Comment 9 Buovjaga 2015-06-09 10:28:59 UTC
Discussed with sophie and I'm changing this to a feature request: "Allow sorting of bookmarks in the navigator in two ways: alphabetically and by order in document"
Comment 10 Cor Nouws 2015-06-09 10:54:42 UTC
FYI: I work (way to slow) on a patch to retrieve the original behaviour.
For the reasoning: see my comment #7
Comment 11 Buovjaga 2015-06-09 11:19:17 UTC
To consider: should the sorting mode selection apply both to the right-click page number AND navigator (see bug 90415)?
Comment 12 Heiko Tietze 2019-06-13 08:14:46 UTC
*** Bug 123514 has been marked as a duplicate of this bug. ***
Comment 13 Adalbert Hanßen 2019-06-16 16:21:13 UTC
Created attachment 152233 [details]
Modification of the test case from above with some additional findings

In Version: 6.3.0.0.alpha1+ Build ID: 77ae0abe21f672cf4b7d2e069f1d40d20edc49a7 bookmarks appear ordered alphabetically in the navigator. 

I took the example given above and derived from it one with some copies of the original text. Bookmarks to the previous bookmarks are created automatically which differ from its ancestors by automatically appended numbers. Therefore we have so many similar looking bookmarks in this version of the file.

At the beginning of this modified test file there is a playground where I noted some of the copied bookmark names in order to try placing hyperlinks to them. 

One can do so by adding the complete name of the hyperlink in the insert hyperlink dialogue, but then you have to type it it correctly which is not very easy in this test case with that many similar bookmark names.

The heading of my text shows how you can circumvent the deplored missing function of ordering bookmarks in the navigatorby appearance in the text: The Insert Bookmark dialogue shows all existing bookmarks ordered by appearance and it has an option "go to" (or double click on one). If one aborts from that, one has gone to the chosen existing bookmark, possibly this is what was wished on the onset of this post.
Comment 14 Heiko Tietze 2022-03-11 09:23:54 UTC
*** Bug 147658 has been marked as a duplicate of this bug. ***
Comment 15 Jim Raykowski 2022-03-12 07:20:36 UTC
Created attachment 178832 [details]
bookmarks sort demo

Is the check menu item shown in the demo enough or would a sub menu 'Sort' having 'Alphabetically' and 'By order in document' radio buttons be better?
Comment 16 ricky.tigg 2022-03-12 14:45:10 UTC
Hello. "sub-menu"; wise anticipation. If there was a unique option aiming at sorting present in UI, unknown would be the sorting type while that option is not selected.
Comment 17 Jim Raykowski 2022-03-12 20:26:03 UTC
The radio button idea to choose sort type seems more useful if there was three sort choices. At present there is only the options to sort alphabetically or by order of occurrence in the document from start to end. It may be that other orderings are of use, for example, order of occurrence from end to start in the document (IOW reverse document order).

Here is an enhancement patch that adds a check menu item to sort alphabetically. When unchecked, the order of occurrence from start to end in the document is used. The patch adds the sort alphabetically check menu item for all content types except 'Comments' and 'Footnotes and Endnotes'. 'References' have always been sorted alphabetically. The patch changes this to be consistence with all the other categories initially listing members in order of occurrence from start to end in the document.

https://gerrit.libreoffice.org/c/core/+/131448
Comment 18 ricky.tigg 2022-03-14 08:07:20 UTC
"three sort choices"; When reverse order options are generally proposed, the overall number of options is double of non-reverse sort options. Then in the present context, four sort choices would be produced.
Comment 19 sdc.blanco 2022-03-14 08:50:47 UTC
(In reply to Jim Raykowski from comment #15)
> Is the check menu item shown in the demo enough 
LGTM.  (and fwiw comment 8 is still valid)
Comment 20 Commit Notification 2022-03-16 07:42:54 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b802cecbc0f57d0ba0d70434cf619a7e91c7393f

tdf#86395 tdf#104253 tdf#147658 tdf#135043 SwNavigator sort enhancement

It will be available in 7.4.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.
Comment 21 Jim Raykowski 2022-03-16 07:43:51 UTC
(In reply to sdc.blanco from comment #19)
> (In reply to Jim Raykowski from comment #15)
> > Is the check menu item shown in the demo enough 
> LGTM.  (and fwiw comment 8 is still valid)

Comment 8 would be doable if it is decided the sort order should persist. Let's fist give it a go without persistence.
Comment 22 ricky.tigg 2022-03-18 12:56:36 UTC
AppImage | https://libreoffice.soluzioniopen.com/daily-version/ | Files not updated since 2022-01-23.
Comment 23 Buovjaga 2022-03-18 12:58:35 UTC
(In reply to ricky.tigg from comment #22)
> AppImage | https://libreoffice.soluzioniopen.com/daily-version/ | Files not
> updated since 2022-01-23.

You can also roll your own appimages: https://wiki.documentfoundation.org/Installing_in_parallel/Linux#Automated_installation
Comment 24 ricky.tigg 2022-03-18 13:57:45 UTC
Own AppImage | Version: 7.4.0.0.alpha0+ / LibreOffice Community; Build ID: 778bbcede813dd51e11ee61583247db1199eda63; CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: gtk3; Locale: fi-FI (fi_FI.UTF-8); UI: en-US; Calc: threaded

Tested.
Comment 25 Stéphane Guillou (stragu) 2023-06-30 22:01:47 UTC
Fixed in 7.4.0 by Jim. Thanks you!Not sure why you removed the target value in the whiteboard?

I could see the mismatch in order of bookmarks in 7.3, and verified the correct document order + the ability to sort alphabetically in 7.4 and 7.5.
Comment 26 Stéphane Guillou (stragu) 2023-07-09 18:06:34 UTC
*** Bug 156202 has been marked as a duplicate of this bug. ***
Comment 27 Commit Notification 2023-12-13 06:24:06 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bb0a2be91930fbae07657f214b53117b9e8cc204

tdf#158276 tdf#86395 Make alphabetical sort setting persist

It will be available in 24.8.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.
Comment 28 Commit Notification 2023-12-15 08:01:57 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/ae8d83c0cca3f721292bceaf358cd03217d5ee39

tdf#158276 tdf#86395 Make alphabetical sort setting persist

It will be available in 24.2.0.0.beta2.

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.