[Libreoffice-bugs] [Bug 142433] New: FILESAVE DOCX unsuitable wrapPolygon for complex shapes
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Sat May 22 15:08:00 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=142433
Bug ID: 142433
Summary: FILESAVE DOCX unsuitable wrapPolygon for complex
shapes
Product: LibreOffice
Version: unspecified
Hardware: x86-64 (AMD64)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Writer
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: rb.henschel at t-online.de
Created attachment 172251
--> https://bugs.documentfoundation.org/attachment.cgi?id=172251&action=edit
Document with failing shapes
The attached document contains some shapes, for which wrapPolygon is totally
wrong. The shapes are filled 80% transparent, so that you can see in Word, what
is rendered behind the shape. Save the document to docx and compare the
rendering in Word with the rendering of the original document in LibreOffice.
The relevant code is below #813 in DocxSdrExport::startDMLAnchorInLine.
https://opengrok.libreoffice.org/xref/core/sw/source/filter/ww8/docxsdrexport.cxx?r=c7c6f0af#813
There the wrap polygon is generated from the coordinates in 'Coordinates' in
CustomShapeGeometry. This fails in following cases:
a) The shape uses in its path curves. In that case the outline of the shape is
not a polygon of the points in 'Coordinates', even if they are all values and
not references to formulas.
b) The coordinates are not given by value but by reference to a formula or
handle.
c) The shape consists of several subpathes. That is not only the case for the
obvious shapes like 'Sun' and 'Callout Cloud'. But it is also the case for
shapes with holes and for shapes, which have darken or lighten parts.
I have some ideas that might help to solve the problem. But I have not worked
them out and have not tested them:
* Use the method TakeContour() from the SdrObject followed by
correctOutmostPolygon() from b2dpolypolygontools.hxx and write out the points
of polygon with index 0.
* Make a copy of the object and convert it to polygons (.uno:ChangePolygon).
Then take all generated polygons and merge them (.uno:Merge). That might work
well with the darken/lighten cases and with holes, but will fail for shapes
with distinct parts. Those might need individual methods.
* Look how our rendering finds the contour. (Where is that code?)
* Make a copy of the object and convert it to bitmap. Use the feature
"Autocontour" of the "Contour Editor". (Where is that code?)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210522/872124bf/attachment.htm>
More information about the Libreoffice-bugs
mailing list