Bug 160077

Summary: FILEOPEN DOCX: image layoutInCell must vertical offset relative to the paragraph, not the page (comment 5)
Product: LibreOffice Reporter: Justin L <jluth>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: jluth
Priority: medium Keywords: filter:docx
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=160049
https://bugs.documentfoundation.org/show_bug.cgi?id=137590
Whiteboard: target:24.8.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 120466    
Attachments: layoutInCell_mso2010.pdf: how it looks in the authoring program
160077_layoutInCell.docx: anchored to top of page margin, but forced into cell
tdf160077_layoutInCellB.docx: needed for images too

Description Justin L 2024-03-06 23:05:54 UTC
Created attachment 193006 [details]
layoutInCell_mso2010.pdf: how it looks in the authoring program

The in-background-through image (following the shape code path since it is rotated) must not be placed relative to the page margins, but must be placed relative to the paragraph area.

Therefore, the image should appear mid-way down the cell, instead of at the top.
 
This is not related to compatibilityMode.
Comment 1 Justin L 2024-03-06 23:09:42 UTC
Created attachment 193007 [details]
160077_layoutInCell.docx: anchored to top of page margin, but forced into cell
Comment 2 Justin L 2024-03-07 21:27:08 UTC
Created attachment 193022 [details]
tdf160077_layoutInCellB.docx: needed for images too
Comment 3 Commit Notification 2024-03-08 10:00:37 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#160077 writerfilter: shape vertRelation is FRAME for layoutinCell

It will be available in 24.8.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 4 Commit Notification 2024-03-08 17:23:34 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/61b1d3a17ff784b7c79a92cbe069a90ce4932535

tdf#160077 unit test: this file was helpful identifying a "bad fix"

It will be available in 24.8.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 Justin L 2024-03-08 17:36:12 UTC
(In reply to Justin L from comment #2)
> Created attachment 193022 [details]
> tdf160077_layoutInCellB.docx: needed for images too

https://gerrit.libreoffice.org/c/core/+/164516 fixes this, but in an unsafe way... Leaving the issue open to address the image path (which keeps the FollowTextFlow attribute, while the shape path didn't).