Bug 162211 - FILEOPEN DOCX: LayoutInCell still needed for proper round-tripping results
Summary: FILEOPEN DOCX: LayoutInCell still needed for proper round-tripping results
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.1.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.2.0 target:24.8.1
Keywords: bibisected, bisected
Depends on:
Blocks: DOCX-Anchor-and-Text-Wrap layoutInCell 160077
  Show dependency treegraph
 
Reported: 2024-07-26 14:41 UTC by Justin L
Modified: 2024-08-24 19:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
160077_layoutInCell_horiRight.docx: looks OK in LO, even when round-tripped, but RT is bad in MS Word (21.95 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-26 14:41 UTC, Justin L
Details
160077_layoutInCell_horiRightRT.docx: round-tripped by 25.2 master (15.76 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-26 15:42 UTC, Justin L
Details
160077_layoutInCell_horiRightRT_mso2019.pdf: how comment 1's round-tripped file looks in Word 2019 (45.92 KB, application/pdf)
2024-07-26 15:43 UTC, Justin L
Details
tdf128646C.docx: argh - this unit test destroyed one of my critical suppositions (24.57 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-07-30 01:05 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2024-07-26 14:41:06 UTC
Created attachment 195536 [details]
160077_layoutInCell_horiRight.docx: looks OK in LO, even when round-tripped, but RT is bad in MS Word

In 7.3.1, the code was changed to ignore LayoutInCell when through wrapping was combined with a horizontal paragraph orientation. However, this ignores vertical implications (kindof fixed in bug 160077) and round-tripping (from a MSO perspective). commit e993638d5ecd33783f2eebdccfa87a81e5a8a2c5
Author: Miklos Vajna on Mon Jan 24 12:53:25 2022 +0100
    DOCX import: fix <wp:anchor layoutInCell="1"> with <wp:wrapNone>

Although it is super tempting to turn layoutInCell off, this is the opposite direction that MSO is going. In CompatibilityMode=15, MSO ignores the value of layoutInCell and always treats it as "on".
Comment 1 Justin L 2024-07-26 15:42:01 UTC
Created attachment 195539 [details]
160077_layoutInCell_horiRightRT.docx: round-tripped by 25.2 master

Opening this file in MS Word (I tried 2010 and 2019), the image shifts into the right column (since it is trying to align with the right side of the overall containing paragraph).

It is also interesting to note that when going to the layout properties in MS Word, it SAYS that the shape is vertically aligned to the top of the page, and when you press OK, it does jump to the top of the page.

So, using this comment's file, there are two additional bugs:
1.) IMPORT: layout of compat14 layoutInCell=off needs to be based on the "anchor" paragraph probably, not the cell paragraph that actually contains the shape.
2.) EXPORT: I assume there is some kind of invalid combination on exporting the vertial position, which MS Word honours, but then tries to change via the dialog.

Both of these bugs are exposed by comment 0's IMPORT turning off layoutInCell.
Comment 2 Justin L 2024-07-26 15:43:30 UTC
Created attachment 195540 [details]
160077_layoutInCell_horiRightRT_mso2019.pdf: how comment 1's round-tripped file looks in Word 2019
Comment 3 Justin L 2024-07-30 01:05:33 UTC
Created attachment 195592 [details]
tdf128646C.docx: argh - this unit test destroyed one of my critical suppositions
Comment 4 Commit Notification 2024-08-08 00:55:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162211 layoutInCell: clean-up unit tests and make some pre-emptive

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 5 Commit Notification 2024-08-08 12:07:18 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2c9f8ad2705834cdbe208373e10a0daad1040fd2

tdf#162211 revert "tdf#160077 writerfilter: shape vertRelation is FRAME

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 6 Commit Notification 2024-08-09 06:48:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/31f87f369fdb40fc746d98443d75af2e9ce2452d

tdf#162211 tdf#160077 tdf#91632 layoutInCell: vert page->margin, *->top

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 Commit Notification 2024-08-10 19:32:32 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/017fe82d7c057c9a41d558ddfbb5c598c8e1998b

tdf#162211 revert "tdf#160077 writerfilter: shape vertRelation is FRAME

It will be available in 24.8.1.

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 8 Commit Notification 2024-08-14 09:22:53 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162211 tdf#137590 layoutInCell: vertical escaping with wrapThrough

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 9 Commit Notification 2024-08-15 07:01:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#162211 writerfilter: don't discard layoutInCell

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 10 Commit Notification 2024-08-17 20:28:09 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0c2d2ca64f796b3f3f0bc8a8d123aa1be99414f1

tdf#162211 tdf#158384 layoutInCell: doTextBoxPositioning better

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 11 Commit Notification 2024-08-17 20:29:14 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/10bc43d6885a38ca4cccaf201df33ebea64736c3

tdf#162211 tdf#160077 layoutInCell: use row margin for MSOLayout

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 12 Commit Notification 2024-08-17 20:31:20 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7144a9c791ab587b4621c2b35611ba2020baab58

tdf#162211 tdf#153909 layoutInCell vml: don't discard layoutInCell

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.