Files
odfstudio/oox/qa
Mike Kaganski 0aff8e29b2 tdf#154074 PPTX import: keep authored path of free bent connectors
A bent connector (bentConnector3/4/5) that is not glued to a shape at both of
its ends has its path fully defined in the file: the preset geometry and its
adjustment values, in a bounding box that may have been resized by hand. Such a
path has to be kept as authored - re-routing it from the endpoints yields a
different shape, because orthogonal routing is heuristic and differs between
applications and over time (PowerPoint likewise keeps the drawn path and does
not reroute these connectors when they are moved or resized).

So far every bent connector was imported as a routed edge and the authored
handle positions were transferred onto the route as EdgeLine deltas. That is
reliable only when both ends are glued, where the route follows from the two
endpoints. With a free end the route escaped in the wrong direction and dropped
a corner, so e.g. a bentConnector4 arrived with two corners instead of three
and its arrow ended in empty space.

Now a connector that is not glued at both ends gets its authored OOXML path
imposed directly on the edge object via SetEdgeTrackPath, which svx then keeps
as a user-defined track instead of re-routing.

To build that path, the point computation that getOOXHandlePositionsHmm already
performed is extracted into a shared helper getOOXConnectorPointsHmm and reused
both to impose the path and to derive the handles, which are simply the
midpoints of its inner segments; this also drops the duplicated
adjustment/size/transform code.

The changed existing connector tests were checked against PowerPoint:
testTdf164623 and testTdf165180 render visually unchanged (their free connectors
already routed correctly, so only the import mechanism changed), while the newly
handled cases are improved.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I468b341c088f33ec7055747d18fe526975ef16e1
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6813
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 20bf9a09d9e19055f8d1d1da383c44c92585e733)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208152
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-07-18 11:35:25 +02:00
..