Created attachment 197415 [details] 24x24 icon for testing 1. Open Writer (for example) 2. Tools - Customize - Toolbars 3. Select a command in Assigned Commands 4. Click Modify - Change Icon 5. Click Import and select a bitmap Repeat step 5 several times, replacing the same bitmap. With gtk3, the whole dialog will grow each time, with the individual icon images themselves also growing. With qt-based UIs, gen and Windows, the dialog will not grow and the icon grid will move down and to the right. The icon selector dialog was welded in 91548e11b37f52aed476996d7d97ad2b45e43ed5. Back then, these unwanted changes did not yet happen. They started with c9956772ec0678498515fb60dca41e9a77457f86 Resolves: tdf#124809 spacing ignored unless WB_ITEMBORDER is set Looking at the changes, reading the code and debugging, it seems the ValueSet::Format function in svtools/source/control/valueset.cxx is the thing doing the work here. If I put a breakpoint into the line that is said to "calculate item offset", `if (nStyle & WB_ITEMBORDER)`, after importing I hit the breakpoint twice and the unwanted change happens after the first hit. While this happens not only when replacing, if you use replacing in the dialog, the relevant dialog code is in SvxIconSelectorDialog::ReplaceGraphicItem of cui/source/customize/cfg.cxx What is the route from SvxIconSelectorDialog::ReplaceGraphicItem to ValueSet::Format I'm not exactly sure. I suppose it goes through ValueSet::QueueReformat in valueset.cxx
Created attachment 197764 [details] demo asserting patch I feel this assert illustrates where things go wrong, this bit of code only want to change the width, but we end up taller than what we started with as an unwanted side effect
https://gerrit.libreoffice.org/c/core/+/177213 looks good to solve this
Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d3c2fcc3f33f09d655904abdfbad62c1db005288 Resolves: tdf#163772 move margin into ValueSet itself 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.
Now it's nice and static with all Linux backends, thanks.