Bug 153253

Summary: FILEOPEN DOCX VML WordArt has wrong height if trim==false
Product: LibreOffice Reporter: Regina Henschel <rb.henschel>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: ilmari.lauhakangas
Priority: medium Keywords: filter:docx
Version: 7.6.0.0 alpha0+   
Hardware: x86-64 (AMD64)   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=153260
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107634    
Attachments: VML WordArt shape with trim==false
PDF exported from office.com

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 '19.1.2.23 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
Confirmed

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (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