Parameter for addShape for a child of a group in oox import

Regina Henschel rb.henschel at t-online.de
Fri Apr 30 14:39:41 UTC 2021


Hi Miklos,

Miklos Vajna schrieb am 30.04.2021 um 10:19:
> Hi Regina,
> 
> On Thu, Apr 29, 2021 at 11:03:14AM +0200, Regina Henschel <rb.henschel at t-online.de> wrote:
>> Overnight, I found a much easier way. I only need to apply the rotation of
>> the child shape around its center after applying the parent transformation.
>>
>> Please excuse me for bothering you with this problem.
> 
> Ah, great. :-) I was thinking about decomposing these various transforms
> to separate scale/translate/rotation and then applying them in the right
> order, or something like that. But if you figured it out already, that's
> even better.

For "normal" cases it works indeed if the shape rotation is applied 
after the group rotation.

But I have found now, that it does not work, for shapes with rotation in 
45..135 or 225..315 deg, see bug 141953. In that case I need the xfrm 
values from the group as individual values. But because of 
aChildTransformation *= aTransformation;
in (#406) Shape::addChildren() it is not possible to recreate them by 
decomposing the aParentTransformation parameter in Shape::createAndInsert().

I have applied a test document and the manually calculation in a 
spreadsheet to the bug, for the case you are interested, how I think the 
resulting shape can be calculated.

So I still need a way to transport the values from the group to its 
children. Besides my first idea to put all group infos into a struct and 
use that instead of the aTransformation parameter, I can also think to 
put them into the grabbag of each child.

Such transport of information from group to child is also needed, if 
e.g. 3D transformations are not made on the individual shapes but on the 
group. MSOffice allows to apply attributes to the group and writes it 
that way to file, but LibreOffice has no attributes on groups.

I'm still interested in you opinion how to design it.

Kind regards
Regina


More information about the LibreOffice mailing list