Bug 162662 - FILEOPEN DOCX: layout loop with 2 pages and a complex full-page group shape
Summary: FILEOPEN DOCX: layout loop with 2 pages and a complex full-page group shape
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:25.2.0 target:24.8.2
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-28 08:20 UTC by Miklos Vajna
Modified: 2024-09-02 14:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Minimal reproducer (16.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-08-28 08:20 UTC, Miklos Vajna
Details
Reproducer in MSO (40.44 KB, image/png)
2024-08-28 08:59 UTC, Timur
Details
Word 2021 desktop rendering (29.54 KB, image/png)
2024-09-02 14:10 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Vajna 2024-08-28 08:20:25 UTC
Created attachment 196057 [details]
Minimal reproducer

Steps to reproduce the problem:

1) Open the attached bugdoc.

2) Check the import result.

Expected result: 2 pages, first page is ~empty, second page has a full-page complex group shape with 17 child text frames, like in Word.

Actual result: the layout loops / never finishes (stopped waiting after 1 minute).
Comment 1 Timur 2024-08-28 08:59:37 UTC
Created attachment 196059 [details]
Reproducer in MSO

Reproducer opens in MSO with 2 pages.
Comment 2 Commit Notification 2024-08-28 12:56:24 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5bd78c7dc4d17378c31207e6640e4d141d2ef5c3

tdf#162662 sw: fix layout loop with full-page anchored shape that wants to wrap

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 3 Commit Notification 2024-08-29 09:08:35 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

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

tdf#162662 sw: fix layout loop with full-page anchored shape that wants to wrap

It will be available in 24.8.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.
Comment 4 Timur 2024-09-02 13:40:19 UTC
can you please explain "Page 2" text that is seen in MSO but not in LO?
Comment 5 Miklos Vajna 2024-09-02 14:10:06 UTC
Created attachment 196184 [details]
Word 2021 desktop rendering

(In reply to Timur from comment #4)
> can you please explain "Page 2" text that is seen in MSO but not in LO?

Not fully. My Word 2021 renders that "page 2" at the bottom of the page, while your MSO shot puts it to a different place, perhaps you used office.com, and Word itself is inconsistent between desktop vs web?

Anyhow, I think what happens on the Writer side is that the doc is buggy, it both requests wrapping and also sets a size that covers the whole body area, so no layout can please both requirements. Writer resolved this conflict by respecting the wanted size, but gives up on the wrap type and goes with no wrapping (wrap through).

Now what Word does, we can only guess. I think what desktop Word does is also giving up on the wrap type, but it seems to have some additional tweak, so it pushes down the conflicting text on the page as much as possible, while we just leave the text as-is.

The whole situation is a bit of a garbage-in-garbage-out (as long as we don't loop or crash), but if you want, you could file a follow-up bug for this remaining difference. (The original confidential document had an empty paragraph there I think, I only added these strings to help debugging.) Does that help?