Trouble with unittests testDmlTextshape and testDmlTextshapeB

Miklos Vajna vmiklos at collabora.com
Wed May 19 08:18:13 UTC 2021


Hi Regina,

On Tue, May 18, 2021 at 08:10:36PM +0200, Regina Henschel <rb.henschel at t-online.de> wrote:
> after having looked over the problems again, I think that it is not enough
> to improve the import. The export must be fixed at the same time, otherwise
> the user gets a heavily modified document after saving and reloading. Until
> now, saving and reloading deliver a mostly unchanged document, because the
> errors in saving and loading cancelled each other out. If the user only
> worked with LibreOffice in docx format, he did not even notice that the
> document would look completely different in Word.

Agreed, once a feature is imported+exported for DOCX, you always have to
consider export when changing import.

> I think, that I have found a wrong part in DrawingML::WriterTransform() in
> oox/source/export/drawingml.cxx. For a group shape not only nLeft and nTop
> need to be zero, but nChildLeft and nChildTop too. Having that changed, only
> tiny adaptions of unit tests are needed.
> 
> But I wonder, why the values are not zero from the beginning. Looking up the
> call chain I see, that rRect gets it position from properties
> "HoriOrientPosition" and "VertOrientPosition". Shouldn't they be zero for a
> group, because all position adaptions are incorporated into the group
> members?

As far as Writer layout is concerned, a group shape is just a shape,
with a size and position. From that point of view, having a non-zero
position on the group shape (which is the position of the bounding box
of its children) makes sense. As you say, this position is not relevant
when it comes to export to DOCX.

Based on this, it seems to me that it's correct to ignore the group
shape position during export, it's not hiding a deeper problem.

> Another export problem is with wrong dist* and effectExtent values. I have
> found calculations with them in DocxSdrExport::startDMLAnchorInline in
> sw/source/filter/ww8/docxsdrexport.cxx. Is that the only place to consider?

If the scope is DOCX export and drawingML shapes, then that should be
the only place, yes. As you found, the shared drawingML export code is
in oox/source/export/.

Regards,

Miklos


More information about the LibreOffice mailing list