Bug 158532 - Toolbar buttons remain greyed out after pasting an image and quickly clicking out of it
Summary: Toolbar buttons remain greyed out after pasting an image and quickly clicking...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.3.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.8.0 target:24.2.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Toolbars
  Show dependency treegraph
 
Reported: 2023-12-05 07:29 UTC by sflda
Modified: 2024-01-03 14:42 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sflda 2023-12-05 07:29:13 UTC
Description:
In LO Writer, if I insert a single-cell table using the toolbar button and it's drop-down dialog, then paste an image into it within about a second or two, after clicking off the recently pasted and now selected image I am unable to use the toolbar button again as it will be greyed out. 

I can still use the Table menu drop down to insert a table with the more comprehensive dialog, but even after doing so the toolbar button will remain unusable. Creating new paragraphs, page breaks, selecting inside tables all do nothing. Selecting any image while in this state and then unselecting that image by clicking off will however return the toolbar button to usefulness.

Speed matters; if I create the table and paste the image in slowly (such as when my course assignment isn't due in 15 minutes) this issue does not happen.

This has been reproducible for me on my machine over reboots and reinstallations of LibreOffice. If I had to wager a guess the interface isn't picking up that it can create tables again due to the speed of the user interaction.

Steps to Reproduce:
1. Have an image in your clipboard.
2. In a Writer document, create a 1x1 table using the toolbar button.
3. Quickly paste the clipboard image into the new table.
4. Click out of the table into the white space of the document.

Actual Results:
The table insert toolbar button is greyed out and cannot be used.

Expected Results:
After pasting the image and clicking out of the table, I should be able to again insert a new table and paste a new image in.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 16; OS: Linux 6.6; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-US (en_US.UTF-8); UI: en-US
7.6.3-3
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2023-12-19 14:29:28 UTC
Reproduced in and recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: fdc87dd56548622e13353b4cf9864232ee0110fb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

as well as 7.6.4.1 and 7.4.7.2 (gen or gtk3 VCL plugins, on macOS too), but not in 7.3.7.2.

No need to use a table, only pasting a picture and clicking off it quickly will reproduce.
Other buttons remain greyed out, like Insert Chart, Page Break, Field, Special Character...
I need to click again on the picture and wait for a couple of seconds before clicking out, before I can use those buttons again.

Bibisected with linux-64-7.4 repo to first bad build commit [117fc385ff2c52860c739a1028d58df3273982b0] which points to 6fa42a728738ccd00bc6f44f8bbf90fe13bba56b which is a cherrypick of:

commit 31cb5b5538b9fd91dafb067ce961f2540555ad2b
author	Miklos Vajna 	Tue Aug 23 11:58:29 2022 +0200
committer	Miklos Vajna 	Tue Aug 23 16:35:33 2022 +0200
sw: fix missing cache invalidation when switching between images
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138724

Miklos, can you please have a look?
Comment 2 Miklos Vajna 2023-12-20 07:40:59 UTC
Yes, I can reproduce the problem. The intent of the above commit to improve things for the case when you switch between two images, and this bug is about switching between the image and the text SfxShell, so there is hope it can be arranged to restore the old behavior for this bug but keep the old use-case working.
Comment 3 Commit Notification 2024-01-03 08:19:56 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a586ce188086ff27b08b8a4de4672c07ddf8ed7c

tdf#158532 sw: fix toolbar buttons remain disabled after pasting an image

It will be available in 24.8.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 4 Commit Notification 2024-01-03 14:42:37 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/adff88fb77ed9e5fd39bd113fde08c5ee06ed2d3

tdf#158532 sw: fix toolbar buttons remain disabled after pasting an image

It will be available in 24.2.0.2.

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.