Created attachment 185989 [details] Document for demonstrating the effect of a frame on moving a chapter up The issue is easier to explain by demonstration. 1. Open the attached document. 2. In Navigator notice "MOVE THIS Heading Level 2" 3. Use context menu or "Move Chapter Down" icon in Navigator Panel to move this heading down. 4. Then use "Move Chapter Up" (or icon in panel) Actual: Heading moved to top in Navigator (and document) (above Level 1 Heading) Expected: Moved back to its original place. Additional information: 1. Example is a simplified version of an actual document where some headings appear in frames. 2. Have also encountered cases where "Move Chapter Down" gives unexpected effects with frames. Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ee5dbd193fa24b46fb980ddd8a6c39ca349d0d01 CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win Locale: da-DK (da_DK); UI: en-US Calc: CL threaded
I confirm it with Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: b5c3a7502f7ff6ccf0f829c1f3a2ba50b8584c41 CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: en-US (de_DE); UI: en-GB Calc: CL threaded Adding Jim Raykowski as expert for navigator
The bug has to do with where frame nodes are stored in the document model (before regular document content). Patches for Bug 143569 made headings that are in frames show in document order. This bug can also be reproduced with a second level Heading appended to the end of the document and then doing "Move Chapter Up". Navigator outline move commands are handled here: sw/source/uibase/utlui/content.cxx void SwContentTree::ExecCommand(std::string_view rCmd, bool bOutlineWithChildren)
For me, holding the Ctrl key and clicking the "Move Chapter Up" button in the Navigator tool box gives the expected result of moving the chapter back to the position it was before the "Move Chapter Down". Holding the Ctrl key and clicking the chapter move buttons in the tool box moves the chapter with out moving sub-chapters. In this case the moved chapter doesn't have sub-chapters so the expected result is seen.
Repro that holding Ctrl and clicking Move Chapter Up/Down works as expected. Also noticed: with Move Chapter Up/Down and frame is anchored to the heading/subheadings being moved, then the frame is moved with the text, and text goes where expected. (i.e., all as expected, no disruption in final location).
Worse yet is the crash that occurs with Ctrl + "Move Chapter Down" for the "A level 2 heading for a change" heading :( I've come up with a patch to fix the bug reported here and the mentioned crash. The problem is, multiple selection moves don't work as the patch stands now. Multiple selection moves are tricky. I did some hacking on this a few years ago. Round two challenge accepted!
Here is a link to a patch that fixes the reported bug and mentioned crash: https://gerrit.libreoffice.org/c/core/+/149944
Jim Raykowski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e27b936fe864cdd2753470e0fef1e3cb1f891555 tdf#154212 SwNavigator: Fix outline up/down handling It will be available in 7.6.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.
Thanks Jim. Can move headings and text up and down now without the "frame" causing the heading/text to jump to the top. (seems hard to test systematically, because there can be many different outline structures, but definitely an improvement!)
I think this is fixed and I forgot to set it as such, so doing it now.
VERIFIED with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: c0c8cffd3541e3cd616c96791b04e7ebf2b2ed03 CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: de-DE (de_DE); UI: en-GB Calc: CL threaded