Bug 160564 - xlink:type="simple" should be valid in draw:object or chart:chart
Summary: xlink:type="simple" should be valid in draw:object or chart:chart
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium minor
Assignee: Laurent Balland
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-06 13:03 UTC by Laurent Balland
Modified: 2024-05-31 08:33 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Balland 2024-04-06 13:03:30 UTC
Description:
When opening a file containing an embedded chart, there is a warning message:
warn:xmloff:1302942:1302942:xmloff/source/chart/SchXMLChartContext.cxx:392: unknown attribute http://www.w3.org/1999/xlink xlink:type value=simple
content.xml contains xlink:type="simple":
<draw:object xlink:href="./Object 1" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad">
which appears to be valid in ODF [1]

[1] https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1419428_253892949

Steps to Reproduce:
1. Create a new empty presentation
2. Insert a default chart via Insert > Chart
3. Save as ODP
4. File > Reload

Actual Results:
A warning message is displayed in the console:
warn:xmloff:1302942:1302942:xmloff/source/chart/SchXMLChartContext.cxx:392: unknown attribute http://www.w3.org/1999/xlink xlink:type value=simple

Expected Results:
No warning message


Reproducible: Always


User Profile Reset: No

Additional Info:
It seems that SchXMLChartContext::startFastElement [2] is missing
case XML_ELEMENT( XLINK, XML_TYPE )
like in ScXMLCellFieldURLContext::startFastElement [3]

[2] https://opengrok.libreoffice.org/xref/core/xmloff/source/chart/SchXMLChartContext.cxx?r=55e9a27a#308
[3] https://opengrok.libreoffice.org/xref/core/sc/source/filter/xml/celltextparacontext.cxx?r=ce6babf7#270
Comment 1 Laurent Balland 2024-04-06 13:05:28 UTC
If saved as FODP, attribute xlink:type is inserted in chart:chart node
Comment 2 Laurent Balland 2024-04-08 11:23:04 UTC
@Regina: any though about this report?
I prepared this commit, in case you agree:
https://gerrit.libreoffice.org/c/core/+/165853
Comment 3 Regina Henschel 2024-04-08 13:06:59 UTC
I think you are right, the attribute xlink:type is allowed in <chart:chart> element. But it is grouped with the xlink:href attribute. This group is optional, but when it exists, both attributes have to be present.

https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#chart-chart-attlist
Comment 4 Commit Notification 2024-05-31 08:25:35 UTC
Laurent Balland committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/15160b7af066579b7600ecf6b28c2099d2553563

tdf#160564 Treat xlink:type for embedded chart

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.