Bug 153253 - FILEOPEN DOCX VML WordArt has wrong height if trim==false
Summary: FILEOPEN DOCX VML WordArt has wrong height if trim==false
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
Keywords: filter:docx
Depends on:
Blocks: FontWork-WordArt
  Show dependency treegraph
Reported: 2023-01-27 21:14 UTC by Regina Henschel
Modified: 2023-03-27 10:17 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

VML WordArt shape with trim==false (38.47 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-01-27 21:14 UTC, Regina Henschel
PDF exported from office.com (33.18 KB, application/pdf)
2023-03-27 10:16 UTC, Buovjaga

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-01-27 21:14:46 UTC
Created attachment 184966 [details]
VML WordArt shape with trim==false

Open attached document in Word and open it in LibreOffice and compare the shape height.

Expected: The height is same in LO as in Word.
Actual: The height in LO is reduced.

The shape is a VML WordArt shape. You get such shape into a docx document, when you have created the docx document from a RTF-format or from a binary format file and keep 'compatibility mode' on.

Reason of the problem is handling of the 'trim' attribute of the <v:textpath> element. That happens in TextpathModel::pushToPropMap(...)  method in https://opengrok.libreoffice.org/xref/core/oox/source/vml/vmlformatting.cxx?r=ceaff89c

In case a 'trim' attribute does not exist and in case of 'trim==false' (the default), the lines #984 to #996 are executed and there the shape height is changed.

But when you look at the definition of 'trim' attribute in ' textpath (Text Layout Path)' section in  ECMA-376 Part 4, you can see, that this attribute does not change the shape size. It only changes the way the text is fit between the paths of the shape.
Comment 1 Regina Henschel 2023-01-27 22:08:42 UTC
Changing the height of the shape in case of 'trim==false' has the advantage, that the text looks similar to the text in Word. But it has the disadvantage, that the changed height will influence the layout of the surrounding text unless the wrap mode "through" or "behind text" was used.

So the real problem is, that the feature 'trim' is not implemented in LO. LO renders the shapes always as if 'trim==true' is set.
Comment 2 Buovjaga 2023-03-27 10:16:38 UTC
Created attachment 186242 [details]
PDF exported from office.com
Comment 3 Buovjaga 2023-03-27 10:17:40 UTC

Arch Linux 64-bit, X11
Version: (X86_64) / LibreOffice Community
Build ID: a9ba09b66feec19206b0b7c6b70c6d905a6dbfe2
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 27 March 2023