Bug 122325 - FILEOPEN PPTX shape with direct values in arcTo command is not rendered
Summary: FILEOPEN PPTX shape with direct values in arcTo command is not rendered
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pptx
Depends on:
Blocks: OOXML-Shapes
  Show dependency treegraph
 
Reported: 2018-12-25 21:58 UTC by Regina Henschel
Modified: 2022-10-31 12:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Shape with arcTo, that is wrongly rendered (29.36 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2018-12-25 21:58 UTC, Regina Henschel
Details
suspicious lines (865 bytes, patch)
2018-12-25 23:39 UTC, Regina Henschel
Details
The example shape copied to docx format (14.43 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-09-01 13:13 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2018-12-25 21:58:17 UTC
Created attachment 147821 [details]
Shape with arcTo, that is wrongly rendered

Open attached document. Notice, the first slide seems to be empty. But the Navigator shows, that there is an element. The second slide has an image, how the shape is rendered in PowerPoint.
Comment 1 Regina Henschel 2018-12-25 23:39:14 UTC
Created attachment 147822 [details]
suspicious lines

custoomshapeproperties.cxx lines 240 and 2241 look very suspicious to me. If I comment them out, the shape is rendered correctly.

If the viewBox is forced to width=0 and height=0 here, the members nCoordWidthG and nCoordHeightG will become zero too by ApplyShapeAttributes() later on. And thus members nCoordWidth and nCoordHeight become zero too in EnhancedCustomShape2d::SetPathSize() in EnhancedCustomShape2d.cxx.

But I'm not familiar with pptx import and cannot estimate, whether such change would break something in other areas.
Comment 2 Aron Budea 2018-12-28 02:29:29 UTC
Confirmed using LO 6.2.0.1 / Windows 7.

The mentioned lines were added in the following commit.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=beba4603ee8e603fff2599bee7f157d90872cb99
author		Muthu Subramanian <sumuthu@collabora.com>	2013-12-27 19:59:22 +0530
committer	Muthu Subramanian <sumuthu@collabora.com>	2013-12-27 19:59:22 +0530

fdo#72998: Custom shapes have improper size.
Comment 3 Regina Henschel 2018-12-28 17:34:43 UTC
Ah, then first a better solution for bug 72998 has to be found. The current "trick" to force viewBox to "0 0 0 0" is also reason for bug 76334.
Comment 4 NISZ LibreOffice Team 2020-09-01 13:13:00 UTC
Created attachment 164967 [details]
The example shape copied to docx format

Also happens if the shape is copied to Word, saved in docx format then opened in Writer. Not PPTX specific.
Comment 5 NISZ LibreOffice Team 2021-01-15 12:55:23 UTC
bug #112192 also seems to have a missing viewbox problem.
Comment 6 Regina Henschel 2022-10-31 12:02:51 UTC
The problem in bug 112192 is different. There the angles of the arcTo command introduce only the two equations to convert the angles from 1/60000 deg in oox to degree in LO but the angles themselves are direct values in oox. Here the angles are references in oox. So the test in https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/customshapeproperties.cxx?r=c70ee4a6#201 is still true even after applying the commit, which subtracts the angle conversion equations from the number of equations.

The bug here requires a rework of how LibreOffice implements the oox feature "values are interpreted in coordinate-system of current shape width/height". ODF allows for custom shapes a missing svg:viewBox which would correspond to that feature. But LO has not implemented that. Instead we have a magic svg:viewBox="0 0 0 0", which prevents rendering if not coupled with SubViewSize.