Description: My styles are in a certain order in my styles list. But when I select one to apply it to my document, upon reopening the list, my last selected style is at the bottom of the list. Steps to Reproduce: 1. Open the styles list on toolbar 2. Select a style 3. Reopen the list Actual Results: Last selected style is at the bottom of the list. Expected Results: List should have stayed in the same order. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.6.5.2 (X86_64) / LibreOffice Community Build ID: 60(Build:2) CPU threads: 12; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR Ubuntu package version: 4:7.6.5-0ubuntu0.23.10.1 Calc: threaded
Created attachment 193619 [details] Screenshot of the mentioned style list : "Titre 1" is at the bottom as it has just been selected, while he should be just above "Titre 2"
I can't confirm it with Version: 24.2.2.2 (X86_64) / LibreOffice Community Build ID: d56cc158d8a96260b836f100ef4b4ef25d6f1a01 CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL threaded Des it also happen with a clean user profile? => NEEDINFO
Dear Kalytis, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Yes, it keeps happening, even with a clean profile.
I can confirm wit Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: b0195d40f3abc343b88f767f4fe109a9c1d44347 CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US Calc: threaded but not with Version: 7.3.7.2 / LibreOffice Community Build ID: 30(Build:2) CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: cs-CZ (cs_CZ.UTF-8); UI: cs-CZ Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.7 Calc: threaded
This seems to have begun at the below commit in bibisect repository/OS linux-64-7.6. Adding Cc: to Heiko Tietze ; Could you possibly take a look at this one? Thanks bd12644c6d48cafa19e0fd5277f1070693c9a8e9 is the first bad commit commit bd12644c6d48cafa19e0fd5277f1070693c9a8e9 Author: Jenkins Build User <tdf@pollux.tdf> Date: Wed Jan 11 17:18:33 2023 +0100 source 95756934cf56e4a9ff58464bc0ed6881c15fe411 145268: Resolves tdf#152666 - Hide default styles for large lists | https://gerrit.libreoffice.org/c/core/+/145268
Let's give this a try. Please test with a nightly build.
Heiko Tietze committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/117bca21b7b068266bb91f1d114e435e0a7ab525 Resolves tdf#160626 - Preserve sorting in SvxStyleToolBoxControl It will be available in 25.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: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I am testing on master now. I don´t know if it is from this commit or not, but if I the last style is Title, than More styles... will have Title size. If the last style is Signature, More Styles... will have that size for text.
Also, I have 23 styles I used in the document that all appear in the dropdown list. In the commit is mentioned: up to 12 default styles. I used for 23 different paragraphs, styles from Contents 1 to Contents 10 and from Heading 1 to Heading 10.
Created attachment 197400 [details] screenshot
Created attachment 197401 [details] screenshot A screenshot for the first aspect.
I tested something on code, and it is working to keep just the last 12 styles. On line 3247: // add used styles, keeping only the latest 12 entries pStyle = xIter->Next(); while (pStyle) { if (aStyles.size() >= 12) { // Remove the oldest style to make room for the newest aStyles.erase(aStyles.begin()); } // Add the latest style to the end of the list aStyles.push_back(pStyle->GetName()); pStyle = xIter->Next(); } It worked for me on by build. ---- Also, another thing that I discovered testing this bug, that the sort is not correct. If you use: Content 1, Content 2 and Content 10, they are sorted: - Content 1, Content 10, Content 2, but should be: - Content 1, Content 2, Content 10.
I played a little bit with sorting and I succeeded sorting correctly: #include <cctype> bool naturalOrderComparator(const rtl::OUString& a, const rtl::OUString& b) { int posA = 0, posB = 0; int lenA = a.getLength(); int lenB = b.getLength(); while (posA < lenA && posB < lenB) { if (std::isdigit(a[posA]) && std::isdigit(b[posB])) { // Extract and compare numeric parts int numA = 0, numB = 0; while (posA < lenA && std::isdigit(a[posA])) { numA = numA * 10 + (a[posA] - '0'); posA++; } while (posB < lenB && std::isdigit(b[posB])) { numB = numB * 10 + (b[posB] - '0'); posB++; } if (numA != numB) { return numA < numB; } } else { // Compare non-numeric parts lexicographically if (a[posA] != b[posB]) { return a[posA] < b[posB]; } posA++; posB++; } } return lenA < lenB; } // Sort aStyles with the custom comparator std::sort(aStyles.begin(), aStyles.end(), naturalOrderComparator); I don't want to change any code. I just tested for myself to test.
(In reply to BogdanB from comment #9) > I am testing on master now. I don´t know if it is from this commit or not, > but if I the last style is Title, than More styles... will have Title size. > If the last style is Signature, More Styles... will have that size for text. This was already reported before: https://bugs.documentfoundation.org/show_bug.cgi?id=159592
Created attachment 197410 [details] Demo document Demo document to test: "Inserts now up to 12 default styles". There are more than 12 default styles in the dropdown.
(In reply to BogdanB from comment #10) > Also, I have 23 styles I used in the document that all appear in the > dropdown list. In the commit is mentioned: up to 12 default styles. I used > for 23 different paragraphs, styles from Contents 1 to Contents 10 and from > Heading 1 to Heading 10. Exactly. The combobox lists three categories: default PS mostly for new documents, used PS filling the list infinitely and replacing the default styles, and the more button. The issue here was that using H1, for example, moves the entry from default to used. I fixed only this issue. Not against other improvements but I see no good way to limit the number of used styles. Well, maybe perfection is not necessary on the control.
Ok. I have verified. Fixed. Thanks, Heiko. Now everything is keeping its place. Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ad3f929a738292a519128192293c92bd5f96f025 CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded Before when choosing Title, it moved on the last line Version: 24.8.1.2 (X86_64) / LibreOffice Community Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6 CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded