Bug 162666 - UI: Styles panel - Scrolling to bottom and/or top of style list is hard with multiple table cells selected: list always jumps back to active style
Summary: UI: Styles panel - Scrolling to bottom and/or top of style list is hard with ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.0.3 release
Hardware: All All
: medium normal
Assignee: Armin Le Grand
URL:
Whiteboard: target:25.2.0 target:24.8.4 target:24...
Keywords: bibisected, regression
Depends on:
Blocks: Sidebar-Properties-Style
  Show dependency treegraph
 
Reported: 2024-08-28 12:59 UTC by andis.lazdins
Modified: 2024-11-06 09:38 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Video demonstrating behaviour of style list (3.22 MB, video/mp4)
2024-10-30 11:26 UTC, andis.lazdins
Details
screen capture of STR comment 5 on recent 25.2.0 master (2.30 MB, image/gif)
2024-10-30 11:44 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andis.lazdins 2024-08-28 12:59:48 UTC
Description:
Scrolling of style list in side panel complicated, the list jumps to selected style during scrolling, and it is very complicate to change paragraph styles if they are in the beginning and end of the list.

Steps to Reproduce:
1.Open writer document with multiple paragraph styles.
2.Open styles in side panel.
3.Try to scroll down or up style list (farthest styles from the selected style). 4.Try select different style at farthest location from the selected style.

Actual Results:
On the attempt to scroll down styles the style list jumps back to the selected style during scrolling and it is nearly not possible not possible to select, for instance, "Table contents" if selected style is "Body text".

Expected Results:
Style list is not jumping back and stays where it is scrolled and it is possible to select other style. 


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.1.1 (X86_64) / LibreOffice Community
Build ID: ef51c4a0cd35185debf25ad9d0db6a1c14bed5a0
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: lv-LV (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 andis.lazdins 2024-08-28 13:11:05 UTC
I just realized that it is not happening every time. I selected View > Sidebar (it was visible also before that) and now I can do anything and scrolling is performing as expected. At least workaround if somebody else have the same issue.
Comment 2 andis.lazdins 2024-08-28 13:26:14 UTC
I found that jumping of style list takes place, if any element in a table is selected, for instance, single cell, row or entire table.
Comment 3 V Stuart Foote 2024-08-29 02:16:13 UTC
Believe this is correct behavior. An object selected on document will reflect its currently assigned style in the SB Styles deck.

When you select a different object, with a different style assigned, the Styles deck will jump to point on the listbox for that style.

Scrolling up or down in the style list (by cursor or by scrollbar) should not be applying a new style selection until "double click", nor should it jump back to an assigned style unless you change the object selection.

Is the object selection changing for you somehow when you scroll the Styles deck listbox up or down?
Comment 4 andis.lazdins 2024-08-29 04:43:53 UTC
At the moment I found this behavior only in tables. Other text elements, also selected, do not affect scrolling of style list and any style can be selected easily.
This is very annoying, since it means that style can be changed easily only cell by cell and not for the whole table or selection of a table elements.
Comment 5 David 2024-08-29 10:52:44 UTC
Confirmed regression in Linux. Version 24.2.5 works properly.

To reproduce:
Create table.
Select at least 2 cells.
Try to change paragraph style to a style that's not currently displayed in list without needing to scroll.
Comment 6 V Stuart Foote 2024-08-29 12:06:45 UTC
Hmm, didn't get this at first. But yes selecting multiple Table cells active, the Listbox of styles continually rereads and repositions to an active assigned style.

Confirmed.

@Jim, is the reread/reposition maybe result of Spotlight implementation?

Version: 24.8.0.3 (X86_64) / LibreOffice Community
Build ID: 0bdf1299c94fe897b119f97f3c613e9dca6be583
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded 

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: f9b5dad09dbdd56ff064096695a946b03e9e2914
CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 7 Jim Raykowski 2024-08-29 20:32:41 UTC
Performing a bibisect using David's STR in comment 5 and linux-64-24.8, the change in behavior seems to have started with this patch:

commit 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c
Author: Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>
Date:   Mon Jan 22 19:18:32 2024 +0100

    ITEM: Solve SfxVoidItem(0) situation

For anyone interested in confirming this see:

https://wiki.documentfoundation.org/QA/Bibisect

https://wiki.documentfoundation.org/QA/Bibisect/Linux
https://bibisect.libreoffice.org/linux-64-24.8

https://wiki.documentfoundation.org/QA/Bibisect/macOS
https://bibisect.libreoffice.org/mac64-24.8

https://wiki.documentfoundation.org/QA/Bibisect/Windows
https://bibisect.libreoffice.org/win64-24.8
Comment 8 BogdanB 2024-10-12 16:17:24 UTC
Jim, I tried ¨git reset¨ and the commit you mentioned, and after that I tried to go back one commit, to see if was before, but in my case, the problem was also before.

Can you try this procedure yourself, I am not so good at git, maybe I omited something.
Comment 9 BogdanB 2024-10-12 16:27:01 UTC
Was so easy to bibisect:
I am getting the same:

author	Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>	2024-01-22 19:18:32 +0100
committer	Armin Le Grand <Armin.Le.Grand@me.com>	2024-01-23 10:30:59 +0100
commit 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c (patch)
tree f46f20f947a37013fb0539ff235216bae149d443
parent db4cb7cee82615973d1be9fd631c1317f1da5820 (diff)
ITEM: Solve SfxVoidItem(0) situation
An instance of SfxVoidItem(0) was used to signal
the SfxItemState::DISABLED. This was done not only
using WhichID == 0, but using isVoidItem() at the
SfxPoolItem. Unfortunately this mixes up with usages
of SfxVoidItems, mostly for UI stuff/Slots.
This also means that all the time an SfxVoidItem
had to be cloned/delete when when added/removed
from ItemSet or ItemHolder. Much more action than
e.g. for INVALID_POOL_ITEM which we already use
by havong just a simple ptr to a single static
instance of an Item. Disabled should do the same
thing.
Unfortunately also the functionality was mixed
with non-SfxItemState::DISABLED purposes and these
were very hard to be separated.
But the current solution works now after some
quirks doing that. It even oes no more need the
isVoidItem() flag at the SfxPoolItem.

Change-Id: I99f03db144f541ae4ea35f3775b3b3d58a375a81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162414
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>

 cad5a2eca916806372f476b380bd34e7d3f388b1 is the first bad commit
commit cad5a2eca916806372f476b380bd34e7d3f388b1
Author: Jenkins Build User <tdf@maggie.tdf>
Date:   Fri Jan 26 09:21:24 2024 +0100

    source 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c
    
    source 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c

 instdir/program/libbasctllo.so          | Bin 2368240 -> 2368256 bytes
 instdir/program/libchartcontrollerlo.so | Bin 4327496 -> 4327440 bytes
 instdir/program/libcuilo.so             | Bin 5784832 -> 5784776 bytes
 instdir/program/libeditenglo.so         | Bin 3583472 -> 3583480 bytes
 instdir/program/libfrmlo.so             | Bin 4848344 -> 4848352 bytes
 instdir/program/libmsfilterlo.so        | Bin 1117208 -> 1117208 bytes
 instdir/program/libmswordlo.so          | Bin 3456928 -> 3456928 bytes
 instdir/program/libpcrlo.so             | Bin 2319280 -> 2319224 bytes
 instdir/program/librptuilo.so           | Bin 1972792 -> 1972792 bytes
 instdir/program/libscfiltlo.so          | Bin 6966232 -> 6966232 bytes
 instdir/program/libsclo.so              | Bin 25009576 -> 25009488 bytes
 instdir/program/libscuilo.so            | Bin 1138384 -> 1138384 bytes
 instdir/program/libsdlo.so              | Bin 11562488 -> 11566528 bytes
 instdir/program/libsduilo.so            | Bin 2363400 -> 2363408 bytes
 instdir/program/libsfxlo.so             | Bin 8802120 -> 8801944 bytes
 instdir/program/libsmlo.so              | Bin 3000144 -> 3000152 bytes
 instdir/program/libsvllo.so             | Bin 3450672 -> 3450672 bytes
 instdir/program/libsvxcorelo.so         | Bin 13577296 -> 13577240 bytes
 instdir/program/libsvxlo.so             | Bin 6089816 -> 6089760 bytes
 instdir/program/libswlo.so              | Bin 26091672 -> 26091624 bytes
 instdir/program/libswuilo.so            | Bin 3401856 -> 3401856 bytes
 instdir/program/setuprc                 |   2 +-
 instdir/program/versionrc               |   2 +-
 23 files changed, 2 insertions(+), 2 deletions(-)
Comment 10 Armin Le Grand 2024-10-30 10:30:40 UTC
Taking a look. Preparing db4cb7cee82615973d1be9fd631c1317f1da5820, the last version before that change to have a compare. SfxVoidItem is/was unfortunately used for multiple purposes, see commit comment for 38072fd7eb7d53237efbe0d8bacc7db1c4f3131c.
Comment 11 Armin Le Grand 2024-10-30 10:38:30 UTC
Tried to reproduce, but failed. Initial description is outdated? Could someone please make a clear, step-by-step description? Also would like an example file 'with multiple paragraph styles', maybe a screencast? Take into account that not everyone uses Writer as much as you do, please.
Comment 12 BogdanB 2024-10-30 11:07:36 UTC
(In reply to Armin Le Grand from comment #11)
> Tried to reproduce, but failed. Initial description is outdated? Could
> someone please make a clear, step-by-step description? Also would like an
> example file 'with multiple paragraph styles', maybe a screencast? Take into
> account that not everyone uses Writer as much as you do, please.

Armin, just insert a table in a new Writer document, with more than 1 cell. Select 2 cells and try to scroll with your mouse in order to choose a style from the sidebar. Before this commit styles on sidebar "stays", after this commit, the styles move like in a try-to-catch-me game. You can not select a certain style, they are running away from your mouse.
Comment 13 andis.lazdins 2024-10-30 11:26:11 UTC
Created attachment 197298 [details]
Video demonstrating behaviour of style list
Comment 14 V Stuart Foote 2024-10-30 11:44:00 UTC
Created attachment 197299 [details]
screen capture of STR comment 5 on recent 25.2.0 master

screen capture of STR as in comment 5, attempting to assign a paragraph style to content of a sw table cell.

Issue is with the SB Styles deck when in the Paragraph style content panel. The Table style content panel is not affected.

We are able to change style of selected paragraphs in their table cells, but the view of the Paragraph style listing on the Styles deck stays anchored to the set style. 

The view of the paragraph style list seems to jump back to that style while trying to mouse scroll or drag of the scroll bar thumb.
Comment 15 Armin Le Grand 2024-10-30 13:53:07 UTC
Thanks to both of you, got it :-)
Comment 16 Armin Le Grand 2024-10-31 11:19:51 UTC
Debugging through it, have to take the changes log from the identified change (thanks for bibisecting!). May have to do with SfxStateCache, that seems to loop (?)
Comment 17 Armin Le Grand 2024-10-31 12:43:32 UTC
I think I found it, did https://gerrit.libreoffice.org/c/core/+/175871 to fix that. Lets see what gerrit has to say
Comment 18 Commit Notification 2024-10-31 16:23:09 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/288d720e4940d8fdd71715e6d339765e90716931

tdf#162666 Make SfxStateCache handle Items correctly

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.
Comment 19 BogdanB 2024-10-31 17:50:04 UTC
Armin, I built LibreOffice just now, and it seems ok with this commit.

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 15eb26d0f22c621f81086fc8d3c6525838adb426
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 20 Thorsten Behrens (allotropia) 2024-10-31 22:01:59 UTC
As per comment 19
Comment 21 Commit Notification 2024-11-01 11:07:53 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/4cc42d9aaf62fa9711782a07a00559a43532dced

tdf#162666 Make SfxStateCache handle Items correctly

It will be available in 24.8.4.

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 22 Cor Nouws 2024-11-04 16:59:42 UTC
indeed is wonderful in Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5debf32cf09e865f2b241df3edd8461b92b5c1bf
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 23 Commit Notification 2024-11-06 09:38:06 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "libreoffice-24-8-3":

https://git.libreoffice.org/core/commit/82ad8c2df714292d0f6cfdee2f1a8312d11f8f5c

tdf#162666 Make SfxStateCache handle Items correctly

It will be available in 24.8.3.

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.