In writer, when using character style, you often have to sue the default style In French UI, it is sorted by name and so appears farfrom the top ("Style par défaut") I think this particular style sould be on the top of the list for all languages
First is "Default Style" then "Bullet" ... "Visited Internet Links" come properly sorted. But with a different localization it happens what you say (tested with 6.2.8.2 german UI). So yes, this needs to be fixed.
Thanks for confirming the bug
The problem is the same with page styles. Default style is not on the top. Shall I fill a new bug or complete this one ?
(In reply to Pierre C from comment #3) > The problem is the same with page styles. Default style is not on the top. > Shall I fill a new bug or complete this one ? Let's handle it here. I changed the summary a bit.
(In reply to Heiko Tietze from comment #4) > (In reply to Pierre C from comment #3) > > The problem is the same with page styles. Default style is not on the top. Hi everyone , After working a lot on this bug I understood that :- - the code pointer for page style is in /sw/source/core/doc/DocumentStylePoolManager.cxx where the styles are declared in line 497 . - the style array is converted to a vector<OUString> in SwStyleNameMapper::GetPageDescUINameArray and after that it is inserted into unordered_map<OUString> in /sw/source/core/doc/SwStyleNameMapper.cxx in the HashFromRange method . I cannot follow the code after this point, also as we are employing an unordered_map in HashFromRange , it does not really sort the elements in any specific order . Where is the actual sorting of style names done then ? Someone please guide me on this .
"Default Style" is hard coded in sfx2/source/dialog/templdlg.cxx static void MakeTree_Impl(StyleTreeArr_Impl& rArr) Maybe use STR_POOLCOLL_STANDARD, STR_POOLPAGE_STANDARD, or STR_TABSTYLE_DEFAULT Look for line with comment // tdf#91106 sort top level styles https://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/templdlg.cxx?r=f7804fc2#611 HTH
Shivam, did you solve this with the latest patches? To lazy to check myself ;-)
(In reply to Heiko Tietze from comment #7) > Shivam, did you solve this with the latest patches? To lazy to check myself > ;-) My patch would work but only for the English UI . Jim gave me some instructions and code pointers, will submit another patch by today . Hope that solves the bug :D
Shivam Kumar Singh committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ddf96414896fd19b2ed82f9e4d4974855cf1e83a tdf#128357 Forcing default style to stay at top in page styles It will be available in 7.0.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.
There's no tag in here. Can it be considered an InterestingHack ?
(In reply to Shivam Kumar Singh from comment #10) > There's no tag in here. Can it be considered an InterestingHack ? Absolutely, it was quite some effort in the end.