Bug 163191 - Dragging headings in Writer navigator crashes LO Writer
Summary: Dragging headings in Writer navigator crashes LO Writer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.3
Keywords:
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2024-09-28 12:01 UTC by andre78ch
Modified: 2024-10-15 18:23 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file for reproducing the bug (596.25 KB, application/vnd.oasis.opendocument.text)
2024-10-13 14:10 UTC, Patrick (volunteer)
Details
Crash log in local master build (127.18 KB, text/plain)
2024-10-13 14:11 UTC, Patrick (volunteer)
Details
Better sample file for reproducing the bug (37.73 KB, application/vnd.oasis.opendocument.text)
2024-10-14 13:04 UTC, Patrick (volunteer)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andre78ch 2024-09-28 12:01:09 UTC
Description:
Headings identified by heading styles (heading 1, heading 2, etc.) in Writer appear in the navigator and have been draggable in previous LO versions, allowing you to rearrange document sections. (Very uselful feature for the composition of longer documents.) 
Now dragging headings in Writer navigator crashes LO Writer.

Steps to Reproduce:
1. Create a Writer document with headings using styles (heading 1, heading 2, etc.)
2. Open the Navigator
3. Activate "Content Navigation View"
4. Drag a heading above or below another to move document sections around

Actual Results:
LO crashes

Expected Results:
The heading should not crash. 


Reproducible: Always


User Profile Reset: Yes

Additional Info:
The header should stays in the place where you have dragged it, and the corresponding text section should have moved in the document to its newly assigned place.
Comment 1 Dieter 2024-10-13 11:26:26 UTC
I can't confrm with

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6
CPU threads: 4; OS: Windows 10 X86_64 (10.0 build 19045); UI render: default; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

So perhaps related to macOS or resolved in actual version. So could you please retest with LO 24.8 or with actual master? Does it also happen, if you use the arrow button to move headings up or down?

=> NEEDINFO
Comment 2 Patrick (volunteer) 2024-10-13 14:10:29 UTC
Created attachment 197031 [details]
Sample file for reproducing the bug
Comment 3 Patrick (volunteer) 2024-10-13 14:11:59 UTC
Created attachment 197032 [details]
Crash log in local master build
Comment 4 Patrick (volunteer) 2024-10-13 14:34:19 UTC
I have submitted the following patch that fixes the bug in my local master build:

https://gerrit.libreoffice.org/c/core/+/174873

However, I am not familiar with the Writer code that the patch changes so someone familiar with the Writer code should review my patch before it is committed.
Comment 5 Patrick (volunteer) 2024-10-14 13:04:23 UTC
Created attachment 197048 [details]
Better sample file for reproducing the bug

I uploaded the wrong file to attachment #197031 [details] so I have uploaded a smaller file that contains paragraphs set to the Heading 1, 2, and 3 styles.
Comment 6 Commit Notification 2024-10-15 01:54:41 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#163191 Fix crash when dragging headings in Writer navigator

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 7 BogdanB 2024-10-15 03:57:22 UTC Comment hidden (obsolete)
Comment 8 BogdanB 2024-10-15 05:18:14 UTC Comment hidden (obsolete)
Comment 9 Patrick (volunteer) 2024-10-15 12:19:57 UTC
(In reply to BogdanB from comment #7)
> BUT, it is not working if you open a new document and try to test the bug.
> After the document is saved, everything works fine.

With the fix, I do not see any crash with a new Writer document on macOS in my local master build.

Version: 25.2.0.0.alpha0+ (AARCH64) / LibreOffice Community
Build ID: 633fad32611e39620218319327428050405a6b1a
CPU threads: 8; OS: macOS 15.0.1; UI render: Skia/Metal; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 10 BogdanB 2024-10-15 12:42:17 UTC Comment hidden (obsolete)
Comment 11 BogdanB 2024-10-15 14:43:48 UTC
No more crash in
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: dfeefe2e97a5412a445a3a508acb2d9ae05138e5
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Crash in (for testing)
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
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 12 Commit Notification 2024-10-15 17:30:27 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#163191 Fix crash when dragging headings in Writer navigator

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.
Comment 13 BogdanB 2024-10-15 18:23:22 UTC
Jim, I have reported the bug with unsaved document here:
https://bugs.documentfoundation.org/show_bug.cgi?id=163448