Bug 154113 - Sections: after copy-paste, layout is broken until reload
Summary: Sections: after copy-paste, layout is broken until reload
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0 target:7.5.3.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Section
  Show dependency treegraph
 
Reported: 2023-03-10 12:40 UTC by Mike Kaganski
Modified: 2023-06-05 14:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Three sections (776 bytes, application/vnd.oasis.opendocument.text)
2023-03-10 12:40 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-03-10 12:40:34 UTC
Created attachment 185883 [details]
Three sections

Open the attached document. It contains a first paragraph with short description, and three sections going after each other, with a single paragraph each, containing the section names.

Select the text as described in the document, copy to clipboard, and paste back to replace the selection.

Since commit 166b5010b402a41b192b1659093a25acf9065fd9, after the paste, the order of the paragraphs changes: the second one becomes the last one. But saving and reloading restores the correct order.

Also the paste changes the sections unexpectedly: the last (third) section gets merged to the first section, and the second section becomes *nested* into the first one. This already happened before the mentioned commit, even in OOo 3.2.0. Possibly this is the real cause of the problem; however, the incorrect re-creation of frames after the paste, so that they do not reflect the underlying document model (which started in 6.4.4), is unexpected.
Comment 1 Dieter 2023-03-25 09:34:42 UTC
(In reply to Mike Kaganski from comment #0)
> Also the paste changes the sections unexpectedly: the last (third) section
> gets merged to the first section, and the second section becomes *nested*
> into the first one.

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

Additional information
Can't confirm, that saving and reloading restores correct order
Comment 2 Commit Notification 2023-04-20 19:36:49 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#154113: do not forget to split the outermost section frame

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.
Comment 3 Mike Kaganski 2023-04-20 19:39:28 UTC
So let me limit this to the incorrect rendering (the swapped order of last two paragraphs), which was a regression, and is fixed now. The behavior of sections (changed number and relations of sections) is different, pre-existing, and unclear what to really expect, so need a different issue.

Closing fixed.
Comment 4 Commit Notification 2023-04-26 07:28:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/20751f74116f6f83a1081ab67bafc1de59c00590

tdf#154113: do not forget to split the outermost section frame

It will be available in 7.5.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 5 Commit Notification 2023-04-27 15:00:43 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-3":

https://git.libreoffice.org/core/commit/6c284972327f5b331aab93de088ce0f97255cbca

tdf#154113: do not forget to split the outermost section frame

It will be available in 7.5.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 6 BogdanB 2023-05-14 19:21:03 UTC
Verified with
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Bad in
Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 7 david 2023-06-05 10:29:34 UTC Comment hidden (spam)