Bug 157315

Summary: A selection mark is set after inserting a file in a Master document
Product: LibreOffice Reporter: Jim Raykowski <raykowj>
Component: WriterAssignee: Jim Raykowski <raykowj>
Status: RESOLVED FIXED    
Severity: normal CC: ilmari.lauhakangas
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard: target:24.2.0
Crash report or crash signature: Regression By:
Attachments: Demo of selection made by mouse click after file insert

Description Jim Raykowski 2023-09-18 20:10:42 UTC
Created attachment 189677 [details]
Demo of selection made by mouse click after file insert

I noticed a selection mark is set in a master document after inserting files. This causes selection to be made by mouse click in the document after inserting a file.

Please see attached video demonstration of the problem.
Comment 1 Jim Raykowski 2023-09-18 20:27:24 UTC
If confirmed as a bug, here is a proposed patch:
https://gerrit.libreoffice.org/c/core/+/157032
Comment 2 Buovjaga 2023-10-02 06:39:10 UTC
Repro when the second file is inserted before the first one.

I would say it's fine to merge your patch.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9eb419b0b0f019f5fbc48ff1a11977e8b041edee
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 2 October 2023
Comment 3 Commit Notification 2023-10-03 01:30:04 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9389102ee5e6adbb0f8b10f8aee60d1899d91d27

tdf#157315 Don't set mark after inserting a file in a Master document

It will be available in 24.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 4 Jim Raykowski 2023-10-03 01:31:38 UTC
Removing the setting of the mark makes inserting a file also insert a text paragraph. This is the same behavior seen when the navigator is used to insert a table of contents. Please see bug 155741 comment 15 more details.