Bug 91106 - 1st Hierarchical level in Styles and Formatting is not alphabetically sorted
Summary: 1st Hierarchical level in Styles and Formatting is not alphabetically sorted
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
4.3.6.2 release
Hardware: All All
: low trivial
Assignee: Michael Stahl
URL:
Whiteboard: target:6.0.0 target:5.4.3 target:6.1....
Keywords: bibisected, bisected, needsDevEval, regression
Depends on:
Blocks:
 
Reported: 2015-05-06 02:16 UTC by Alexandre de Verteuil
Modified: 2018-03-21 14:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of hierarchical group of character styles. (52.79 KB, image/png)
2015-05-06 02:16 UTC, Alexandre de Verteuil
Details
Screenshot of Hierarchical group of paragraph styles with some expanded sublevels. (64.48 KB, image/png)
2015-05-06 02:17 UTC, Alexandre de Verteuil
Details
Screenshot of XML from a flat ODT file opened in Firefox showing document's styles. (497.72 KB, image/png)
2015-05-06 02:18 UTC, Alexandre de Verteuil
Details
Extract of document's styles in XML format from a flat ODT. (3.93 KB, text/plain)
2015-05-06 02:19 UTC, Alexandre de Verteuil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre de Verteuil 2015-05-06 02:16:16 UTC
Created attachment 115372 [details]
Screenshot of hierarchical group of character styles.

Refer to the feature documented in:
https://help.libreoffice.org/Writer/Styles_in_Writer

When selecting the Hierarchical group, I expect sibling styles to be sorted alphabetically.

Styles that have a parent are correctly listed in alphabetical order.


Problem:
Top level styles are listed in the order they are read from XML rather than alphabetically.
Comment 1 Alexandre de Verteuil 2015-05-06 02:17:10 UTC
Created attachment 115373 [details]
Screenshot of Hierarchical group of paragraph styles with some expanded sublevels.
Comment 2 Alexandre de Verteuil 2015-05-06 02:18:07 UTC
Created attachment 115374 [details]
Screenshot of XML from a flat ODT file opened in Firefox showing document's styles.
Comment 3 Alexandre de Verteuil 2015-05-06 02:19:40 UTC
Created attachment 115375 [details]
Extract of document's styles in XML format from a flat ODT.
Comment 4 Joel Madero 2015-05-06 02:52:06 UTC
When you say "Refer to the feature documented in" what are you actually referring to? I don't see a document in that wiki article. Can you attach it directly to the bug to make it easier for us to reference? 

Thanks
Comment 5 Alexandre de Verteuil 2015-05-06 03:40:36 UTC
I agree I could have chosen a more straightforward way to set the context; there is no attached OTD document to look at, just the wiki page itself.

I'll rephrase more simply:

"In the Styles and Formatting window, when selecting the Hierarchical group, I expect sibling styles to be sorted alphabetically."

Best regards,
--
Alexandre de Verteuil
Comment 6 Joel Madero 2015-05-06 03:55:36 UTC
Oh I see now - 

Confirmed on:
Ubuntu 15.04 x 64
LibreOffice 4.4.2.2 release
LibreOffice 3.3 is good so it's a regression

Marking as:
New - confirmed
Trivial - no impact really on professional quality work
Low - bumped because it's a regression

Probably easy to fix so requesting input from devs.
Comment 7 Joel Madero 2015-05-06 04:16:43 UTC
f558a584cdbd1eed10f886939a5cc2e86049b08c is the first bad commit
commit f558a584cdbd1eed10f886939a5cc2e86049b08c
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Thu Oct 17 15:48:30 2013 +0000

    source-hash-61db96daa87754af24355d7ac94ee0305f22ff87
    
    commit 61db96daa87754af24355d7ac94ee0305f22ff87
    Author:     Radu Ioan <ioan.radu.g@gmail.com>
    AuthorDate: Sat Jun 29 17:38:04 2013 +0300
    Commit:     Bosdonnat Cedric <cedric.bosdonnat@free.fr>
    CommitDate: Wed Jul 3 07:59:33 2013 +0000
    
        fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFO
    
        - replaced RTL_CONTEXT_ with SAL_INFO
        - replace OSL_* with SAL_*
    
        Change-Id: I26761cf1d4c1cfe21dec7d8ede6df6f177bf2c3e
        Reviewed-on: https://gerrit.libreoffice.org/4620
        Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
        Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>

:100644 100644 394ec1fef6ddb59da0db4519dc59ae4f23fb8c01 01a521d81b05da62fc741f4064b361b8fc660907 M	ccache.log
:100644 100644 cc9d889b1b6c4601c6cc08c76276bbba513cc02e 8cac93c0ec3bcfc227282d1749f0cfdbd09d2f1b M	commitmsg
:100644 100644 c389ffe6b83dd7bd720efd1b3697d7555b41ddcb e4f1b8f0fa234364dce0bcb5cf8250b29f79554c M	dev-install.log
:100644 100644 3bdb75e943706be909acc784ea57384f4ea939c1 fb93205802763858eb230d6dbff4d0a562b16671 M	make.log
:040000 040000 15e1b3977a342965d3bf11bd0f9259931df7521a d81597b06f640c259130c06a16e8b026acfc3867 M	opt


# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect good e02439a3d6297a1f5334fa558ddec5ef4212c574
# bad: [4850941efe43ae800be5c76e1102ab80ac2c085d] source-hash-980a6e552502f02f12c15bfb1c9f8e6269499f4b
git bisect bad 4850941efe43ae800be5c76e1102ab80ac2c085d
# skip: [a043626b542eb8314218d7439534dce2fc325304] source-hash-9379a922c07df3cdb7d567cc88dfaaa39ead3681
git bisect skip a043626b542eb8314218d7439534dce2fc325304
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# bad: [1d4980621741d3050a5fe61b247c157d769988f2] source-hash-89d01a7d8028ddb765e02c116d202a2435894217
git bisect bad 1d4980621741d3050a5fe61b247c157d769988f2
# bad: [ba096f438393091574da98fe7b8e6b05182a8971] source-hash-8499e78ca03c792f4fa2650e02b519094ba0baa8
git bisect bad ba096f438393091574da98fe7b8e6b05182a8971
# good: [9daa289e178460daaafa4b3911031df5b8736218] source-hash-704292996a3731a61339b1a4a5c90c9403aa095f
git bisect good 9daa289e178460daaafa4b3911031df5b8736218
# bad: [34eab3946c46bb7273ba4ca395db9c4421dd232f] source-hash-e962805b31074d6b6a2ed0db6452769448337553
git bisect bad 34eab3946c46bb7273ba4ca395db9c4421dd232f
# bad: [7f958321368b190c941b23cc219d62d0420415af] source-hash-b3f41543851e9985c6c7ba133c32753c9bc732c1
git bisect bad 7f958321368b190c941b23cc219d62d0420415af
# bad: [7e1458eeba4fb40a796b1318a034410a97b6b24b] source-hash-926275d07184d441b3bfa1ceca26c4c1f2bc61db
git bisect bad 7e1458eeba4fb40a796b1318a034410a97b6b24b
# good: [bb5ad7a1787aa87f172ccc8ed1f5be8374184a8f] source-hash-6bf79576aeca243db553ed3b5eade492dc35337b
git bisect good bb5ad7a1787aa87f172ccc8ed1f5be8374184a8f
# bad: [f558a584cdbd1eed10f886939a5cc2e86049b08c] source-hash-61db96daa87754af24355d7ac94ee0305f22ff87
git bisect bad f558a584cdbd1eed10f886939a5cc2e86049b08c
# first bad commit: [f558a584cdbd1eed10f886939a5cc2e86049b08c] source-hash-61db96daa87754af24355d7ac94ee0305f22ff87
Comment 8 Andras Timar 2015-06-18 21:29:00 UTC
bisected, first bad commit:
commit 8f04b172c5c78fa80c3692a729f0191425195869
Author: Michael Stahl <mstahl@redhat.com>
Date:   Tue Jul 2 20:46:33 2013 +0200

    fdo#61429: Stylist: try a little harder to restore "hierarchical"
    
    Change-Id: I30972224c5a9aa12c4ef4c2b5ca80e7aece0baad
Comment 9 Robinson Tryon (qubit) 2015-12-14 05:15:55 UTC Comment hidden (obsolete)
Comment 10 Xisco Faulí 2016-09-26 15:21:16 UTC
Adding Cc: to Michael Stahl
Comment 11 Xisco Faulí 2017-09-29 08:53:35 UTC Comment hidden (obsolete, spam)
Comment 12 Michael Stahl 2017-09-29 18:56:09 UTC
hopefully fixed in master now
Comment 13 Commit Notification 2017-09-29 18:56:29 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=41af2a9e26f3ee6b505b343120d5df3617ba5c49

tdf#91106 sfx2: Stylist: sort top-level styles in hierarchical mode

It will be available in 6.0.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.
Comment 14 Commit Notification 2017-10-03 15:20:00 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=729752b2df5c64429aff10628680d91c8bbbe1a6&h=libreoffice-5-4

tdf#91106 sfx2: Stylist: sort top-level styles in hierarchical mode

It will be available in 5.4.3.

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.
Comment 15 Kenneth Hanson 2017-12-04 02:17:05 UTC
I think there is a problem with the recent patch. Now "Default Style" is alphabetized as well. There are a few reasons I think this is bad.

1) There is a meaningful difference between the default and other styles, such that the default should stay at the top.

2) In the case of character styles, "Default Style" is not actually a style, but a way to remove the character style. Alphabetizing it with the rest obscures this fact even more than before.

3) Since the paragraph styles are organized into a hierarchy under "Default Style", it does appears at the top still, creating an inconsistency with the other types of styles.

(Should I change the bug status for these kinds of issues?)
Comment 16 Commit Notification 2018-03-13 21:47:17 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd67ee14e769ebdf1e43d55e0117f70f90d53053

tdf#91106 sfx2: Stylist hierarchical: sort the Default Style first

It will be available in 6.1.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.
Comment 17 Commit Notification 2018-03-19 20:29:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=21f220fce05bb99964f098247786eec014e56902&h=libreoffice-6-0

tdf#91106 sfx2: Stylist hierarchical: sort the Default Style first

It will be available in 6.0.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.
Comment 18 Commit Notification 2018-03-21 14:10:49 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8256df2bb3823f318d2131f513d62784e702b90c&h=libreoffice-5-4

tdf#91106 sfx2: Stylist hierarchical: sort the Default Style first

It will be available in 5.4.7.

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.