Bug 112782 - PIVOT CHARTS: Save to strict ODF 1.2 produces invalid file
Summary: PIVOT CHARTS: Save to strict ODF 1.2 produces invalid file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.3.0 target:6.2.0.2 target:6.1.5
Keywords: filter:odf
Depends on:
Blocks: Pivot-Chart ODF-export-invalid
  Show dependency treegraph
 
Reported: 2017-09-30 17:11 UTC by Regina Henschel
Modified: 2019-01-15 17:25 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sheet with pivot table and pivot chart (18.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-09-30 17:11 UTC, Regina Henschel
Details
The original file with the pivot chart (19.34 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2017-11-04 21:23 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-09-30 17:11:56 UTC
Created attachment 136652 [details]
sheet with pivot table and pivot chart

Open attached file and save it to strict ODF 1.2.

The resulting file has in Object 1 (which is the chart) the invalid attribute "data-pilot-source". When saving to strict ODF 1.2. not only the namespace loext has to be removed, but the entire attribute.

The same kind of error is with attributes "value-type" (bug ?) in a table-cell and "repeat-item-labels" (bug 112484) in data-pilot-level in content.xml. But that errors exists before and are not introduced with the new feature "pivot charts".



I have used Version: 6.0.0.0.alpha0+
Build ID: 499194508c8cf91fbbc21f882bcf4ace77e19eaa
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-09-30_06:14:26
Locale: de-DE (de_DE); Calc: group
Comment 1 Buovjaga 2017-11-02 16:41:03 UTC
I saved it as ODF 1.2, unzipped, went to Object 1 folder and examined all the .xmls. I was unable to find data-pilot-source in any of them.

Arch Linux 64-bit, KDE Plasma 5
Version: 6.0.0.0.alpha1+
Build ID: fff7097f1ed8493de099d79aa0613ea6b309100a
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 2nd 2017
Comment 2 Aron Budea 2017-11-04 18:38:32 UTC
No repro here, either. I assume Load/Save -> General -> ODF format version has to be set to 1.2 for testing this, right?

Version: 6.0.0.0.alpha1+
Build ID: 8ce49eab696d830d420fbf48b22ac151167bbd62
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-11-03_23:12:37
Locale: en-US (en_US); Calc: CL
Comment 3 Buovjaga 2017-11-04 18:58:36 UTC
(In reply to Aron Budea from comment #2)
> No repro here, either. I assume Load/Save -> General -> ODF format version
> has to be set to 1.2 for testing this, right?

That is correct.
Comment 4 Regina Henschel 2017-11-04 21:23:11 UTC
Created attachment 137526 [details]
The original file with the pivot chart

My fault. I have uploaded the result, not the original file. The new, correct file contains a pivot chart. A pivot chart is not only connected to the pivot table, but the chart itself has filter buttons.

After saving in ODF 1.2 format, the chart is no longer a pivot chart, because the feature is not available in ODF 1.2 strict, but it is a LO extension.

Please try the steps again with the new file.
Comment 5 Aron Budea 2017-11-04 22:47:59 UTC
Yes, reproducible now.
Comment 6 QA Administrators 2018-11-05 03:44:21 UTC Comment hidden (obsolete)
Comment 7 Regina Henschel 2018-11-05 23:25:33 UTC
The error still exists in Version: 6.2.0.0.alpha1+ (x64)
Build ID: e33424dd887cb1a11a3dba2513ef0f4bf93a6dbe
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-11-01_00:43:29
Locale: de-DE (en_US); Calc: CL
Comment 8 Julien Nabet 2018-12-30 11:40:55 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Relevant part of the assert:
#4  0x00007fffed4b2b85 in SvXMLNamespaceMap::GetQNameByKey(unsigned short, rtl::OUString const&, bool) const
    (this=0x55555c4dacd0, nKey=43, rLocalName="data-pilot-source", bCache=true) at /home/julien/lo/libreoffice/xmloff/source/core/nmspmap.cxx:261
#5  0x00007fffed4d16fd in SvXMLExport::AddAttribute(unsigned short, xmloff::token::XMLTokenEnum, rtl::OUString const&)
    (this=0x55555c2ff660, nPrefixKey=43, eName=xmloff::token::XML_DATA_PILOT_SOURCE, rValue="DataPilot1") at /home/julien/lo/libreoffice/xmloff/source/core/xmlexp.cxx:954
#6  0x00007fffed3e1a1c in SchXMLExportHelper_Impl::parseDocument(com::sun::star::uno::Reference<com::sun::star::chart::XChartDocument> const&, bool, bool)
    (this=0x55555c4e6b00, rChartDoc=uno::Reference to (class chart::wrapper::ChartDocumentWrapper *) 0x555558168740, bExportContent=true, bIncludeTable=false)
    at /home/julien/lo/libreoffice/xmloff/source/chart/SchXMLExport.cxx:1204
Comment 9 Julien Nabet 2018-12-30 11:47:54 UTC
If we fix the problem of bt already quoted, we've got another assert:
#4  0x00007fffed4b2ba1 in SvXMLNamespaceMap::GetQNameByKey(unsigned short, rtl::OUString const&, bool) const
    (this=0x55555c48c100, nKey=42, rLocalName="repeat-item-labels", bCache=true) at /home/julien/lo/libreoffice/xmloff/source/core/nmspmap.cxx:261
#5  0x00007fffed4d1719 in SvXMLExport::AddAttribute(unsigned short, xmloff::token::XMLTokenEnum, rtl::OUString const&)
    (this=0x55555c2ca470, nPrefixKey=42, eName=xmloff::token::XML_REPEAT_ITEM_LABELS, rValue="false") at /home/julien/lo/libreoffice/xmloff/source/core/xmlexp.cxx:954
#6  0x00007fffdde4a27c in ScXMLExportDataPilot::WriteLevels(ScDPSaveDimension const*) (this=0x7ffffffef410, pDim=0x5555582e6810)
    at /home/julien/lo/libreoffice/sc/source/filter/xml/XMLExportDataPilot.cxx:499
which corresponds to tdf#112484
Comment 10 Julien Nabet 2018-12-30 12:11:52 UTC
https://gerrit.libreoffice.org/#/c/65742/ for the first bt.

The second bt will be fixed with https://gerrit.libreoffice.org/#/c/65740/ concerning tdf#112484
Comment 11 Commit Notification 2018-12-31 20:44:00 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/18b9f23f13fd503e94d669ab80b5d2354d1817a1%5E%21

tdf#112782: data-pilot-source is invalid in odf1.2 strict

It will be available in 6.3.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.
Comment 12 Commit Notification 2019-01-08 13:23:57 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/eee044b76a2c4ef515475004a550dbd11635e5df%5E%21

tdf#112782: data-pilot-source is invalid in odf1.2 strict

It will be available in 6.2.0.2.

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.
Comment 13 Commit Notification 2019-01-15 17:13:53 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/6aa9f0980612d5c7dcc02cfe11babb73605be4ca%5E%21

tdf#112782: data-pilot-source is invalid in odf1.2 strict

It will be available in 6.1.5.

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.