How to export a shape, which is contained in a frame, to docx?

Regina Henschel rb.henschel at t-online.de
Sun Jan 15 00:56:09 UTC 2023


Hi all,

I ran into the above problem while investigating how to export a 
Fontwork shape to docx.

Currently LO writes a <mc:AlternateContent> for the frame. The 
<mc:Choice> contains the frame content without the shape. The shape 
itself is written after the <mc:AlternateContent>. The <mc:Fallback> 
contains the frame content _and_ a VML-shape.

Problems:
The shape has a wrong position, because the position of the frame is not 
considered.
The shape is written with <mc:AlternateContent> with <mc:Choice> and 
<mc:Fallback>. Thus a consumer, which uses the Fallback gets the shape 
twice.

In case the shape is a Fontwork shape it does not work at all.
In some cases the shape is written as VML shape (tdf#78553). In those 
cases the shape is not written with <mc:AlternateContent> but only as 
VML shape. But because the referenced shapetype element is written in 
the <mc:Fallback> tree of the frame, it is unknown to a current Word 
version as Word skips the Fallback tree. And thus a shape object exists, 
but is empty.
In the other cases the shape is written as DML shape with 
<mc:AlternateContent>. But in the <mc:Fallback> tree the VML shape 
contains an <txbxContent> element in addition to the <textpath> element. 
That results in an invalid file, which cannot be opened by a Word 
versions, which uses the Fallback tree. That problem should be fixed in 
tdf#78553, but the fix only considers two special Fontwork types.

The VML text box in Word is able to contain VML shapes. A modern DML 
text box in Word is not able to contain shapes, but can only contain 
images. In both cases they are treated as 'anchor as character'.

So my question is,
What is the desired behavior for export of a shape, which is inside a 
frame? What gives the best user experience?

Kind regards
Regina


More information about the LibreOffice mailing list