Bug 148743 - UI Issue: TOC->Edit Index->Assign Styles; Styles aren't sorted. (Win or gen)
Summary: UI Issue: TOC->Edit Index->Assign Styles; Styles aren't sorted. (Win or gen)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.0.3 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.0.2 target:7.3.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-04-23 07:38 UTC by Jambunathan K
Modified: 2022-07-23 12:13 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By: Caolán McNamara


Attachments
Sample ODT file which has LOTS and LOTS of Custom Paragraph Styles (26.42 KB, application/vnd.oasis.opendocument.text)
2022-04-23 07:38 UTC, Jambunathan K
Details
Cicking on `Styles` header doesn't re-sort the `Style` names (212.31 KB, image/png)
2022-04-23 07:46 UTC, Jambunathan K
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jambunathan K 2022-04-23 07:38:17 UTC
Created attachment 179740 [details]
Sample ODT file which has LOTS and LOTS of Custom Paragraph Styles

1.  Open the attached `ODT` file.
2. Place cursor on the TOC, Right-Click, Edit Index -> Assign Styles 
3. In the resulting dialog, note the `triangle` in the `Styles` header field.  It "suggests" that the Styles are sorted alphabetically.  But in fact the styles are not sorted.  Click on the `styles` header field once more to "force" sorting.  Note that the style names aren't getting sorted.

See attached screenshot for what I mean.


As an aside, I would have appreciated if there is a way to "narrow" the style names to those that are actually mapped to a non-zero level.  

My gut feeling is that there is a scope for improving the "Assign Styles" UI.
Comment 1 Jambunathan K 2022-04-23 07:46:38 UTC
Created attachment 179741 [details]
Cicking on `Styles` header doesn't re-sort the `Style` names
Comment 2 Jambunathan K 2022-04-23 07:47:18 UTC
Version: 7.3.3.1 / LibreOffice Community
Build ID: 30(Build:1)
CPU threads: 4; OS: Linux 5.17; UI render: default; VCL: x11
Locale: en-IN (en_IN); UI: en-US
Debian package version: 1:7.3.3~rc1-2
Calc: threaded
Comment 3 Telesto 2022-04-25 12:02:43 UTC
Confirm
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4659fc2f0a7223a89446edff0b77e58758b5edf5
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (nl_NL); UI: en-US
Calc: CL

1.  Open the attached `ODT` file.
2. Place cursor on the TOC, Right-Click, Edit Index -> Assign Styles 
3. Type Tab
4. Press Assign Styles
5. Scroll through the list.. notice content not being sorted.. 
Compare with Styles tab -> and the list with paragraph styles

Also there indeed at sorting triangle..
Comment 4 Telesto 2022-04-25 12:07:41 UTC
Also in
Version: 7.1.0.0.beta1+ (x64)
Build ID: f9fab4203c1aa0b9a3f27ce2713b6d5addc7df19
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

not in 
6.4
Comment 5 Andreas Heinisch 2022-06-29 08:27:54 UTC
It is sorted in 6.4 but the triangle at the top does nothing. I think we could drop the triangle, show all the selected styles (> 0) at the beginning, and then sort the rest.

Opinions?
Comment 6 Aron Budea 2022-07-15 00:35:22 UTC
This is fine with GTK3 VCL plugin, but can be reproduced with gen in Linux.

It went bad in two steps, sorting stopped working with the following commit, bibisected using repo bibisect-linux-64-6.2.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=3b0b390bab5f6e58492363adda891cdfb6774eea
author		Caolán McNamara <caolanm@redhat.com>	2018-12-10 11:32:51 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2018-12-12 17:05:07 +0100

"weld SwAddStylesDlg"

Then the list became unordered with the following commit in 7.2. Adding CC: to Caolán McNamara.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=cd384e2d31f74223948ea70d8aa3c318d3ceeb50
author		Caolán McNamara <caolanm@redhat.com>	2020-06-05 16:11:39 +0100
committer	Caolán McNamara <caolanm@redhat.com>	2020-06-08 20:21:35 +0200

"rework treeview initial toggle button col to be like expander col"
Comment 7 Commit Notification 2022-07-21 15:15:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8525e8bd9bc90139c97251f5fb49cf37dc07dbdc

Resolves: tdf#148743 TOC->Edit Index->Assign Styles; Styles aren't sorted

It will be available in 7.5.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 8 Caolán McNamara 2022-07-21 15:16:13 UTC
done in trunk, backport to 7-4 and 7-3 in gerrit
Comment 9 Commit Notification 2022-07-23 12:12:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/47e9c7d433e7f23019ea4ae68e08d82ae9c7e3e3

Resolves: tdf#148743 TOC->Edit Index->Assign Styles; Styles aren't sorted

It will be available in 7.4.0.2.

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 10 Commit Notification 2022-07-23 12:13:51 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/6344bb8b24d8250508f29457508f0daf479e5b4c

Resolves: tdf#148743 TOC->Edit Index->Assign Styles; Styles aren't sorted

It will be available in 7.3.6.

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.