Bug 166201 - FILEOPEN DOCX: simplePos is defined in EMUs, not TWIPs
Summary: FILEOPEN DOCX: simplePos is defined in EMUs, not TWIPs
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: filter:docx
Depends on:
Blocks: DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2025-04-15 22:03 UTC by Justin L
Modified: 2025-04-16 14:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
simplePos.docx: the example file (64.50 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-04-15 22:03 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-04-15 22:03:05 UTC
Created attachment 200356 [details]
simplePos.docx: the example file

I'm not sure what program generates DOCX files containing simplePos=true (because the first DML version is MS Word 2010, and that one doesn't), but IF it did and had non-zero  values, then the image would have been misplaced in LO, because we were treating the X and Y ST_Coordinates as if they were specified in TWIPs.

However, the documentation says "The possible values for this attribute are defined by the ST_Coordinate simple type". 

20.1.10.16 ST_Coordinate (Coordinate)
This simple type represents a one dimensional position or length as either:
 - EMUs.
 - A number followed immediately by a unit identifier.

This simple type is a union of the following types: 
 - The ST_CoordinateUnqualified simple type (§20.1.10.19). This simple type represents a one dimensional position or length in EMUs.
 - The ST_UniversalMeasure simple type (§22.9.2.15).


Steps to reproduce:
-open simplePos.docx

The image should be at the bottom right of the page.
Comment 1 Commit Notification 2025-04-15 23:56:17 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/356f916d0e7dbab7f871c3feb19c6e1292c2a2f5

tdf#166201 docx import: simplePos is defined in EMUs, not TWIPs

It will be available in 25.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 2 Commit Notification 2025-04-16 14:18:54 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#166201 docx import: ST_Coordinates as UniversalMeasure

It will be available in 25.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.