Do not start a:path with lnTo in export to OOXML
commit7ae899e1e2f28e9be4bcd4fb6786bc6999f3ba8d
authorRegina Henschel <rb.henschel@t-online.de>
Sat, 23 Apr 2022 19:52:29 +0000 (23 21:52 +0200)
committerXisco Fauli <xiscofauli@libreoffice.org>
Mon, 25 Apr 2022 22:01:49 +0000 (26 00:01 +0200)
tree4a2c6bf9ca2865f6ca864be34b3fdd1577c7e683
parentf2458bab5d67a988feb9ba72d70e0649a979fcb1
Do not start a:path with lnTo in export to OOXML

This is a follow up to commit 2029b2f6dd0109c5892e5ac5640022b31fe42fd2

The commands A, W, T or L of a draw:enhanced-path draw a line from
current point to start of the arc or end of line, respectivly. If
there is no current point the path is faulty and behavior is not
defined in ODF.

LibreOffice is tolerant and makes a move to the start point of the
arc or to the end point of the line. With this patch we do the same
now in export to OOXML, so the user gets the same shape geometry as in
LO. If a path starts with lnTo, MS Office will show nothing.

I wouldn't care about user-created faulty paths, but LO produces such
faulty path when an EllipseRibbon shape from binary MS Office is
imported. Even when that will be fixed, we need the fix here, because
the faulty path had been written to document markup and will be used
when such document is opened.

Change-Id: Ic52ec3bc78231b26efb592ddadee2e3042fdc065
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133349
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133370
oox/qa/unit/data/FaultyPathStart.odp [new file with mode: 0644]
oox/qa/unit/export.cxx
oox/source/export/drawingml.cxx