Bug 123218 - FILESAVE OOXML Doughnut chart circles exported in a different order
Summary: FILESAVE OOXML Doughnut chart circles exported in a different order
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: Tünde Tóth
URL:
Whiteboard: target:7.1.0
Keywords: filter:docx
Depends on:
Blocks: OOXML-Chart
  Show dependency treegraph
 
Reported: 2019-02-07 08:30 UTC by NISZ LibreOffice Team
Modified: 2020-09-14 09:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the problem in Writer with the expected result (above) and the wrong result after filesave and reload (below). (218.23 KB, image/png)
2019-02-07 08:31 UTC, NISZ LibreOffice Team
Details
Example file from Word with the wrong circle order. (14.61 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-02-07 08:31 UTC, NISZ LibreOffice Team
Details
The original odt file from Writer with the right circle order. (The docx file should look like this). (20.43 KB, application/binary)
2019-02-07 08:31 UTC, NISZ LibreOffice Team
Details
mso example docx file with lo doughnut chart default values datatable (31.91 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-02-07 13:42 UTC, NISZ LibreOffice Team
Details
comparing mso and lo behavior with lo doughnut chart default datatable values (231.89 KB, image/png)
2019-02-07 13:43 UTC, NISZ LibreOffice Team
Details
Naive Excel correctly Roundtrips (13.34 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2019-02-09 20:54 UTC, Luke
Details
Native Calc shows XLS and XLSX affected (18.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-02-09 20:55 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-02-07 08:30:20 UTC
Description:
If creating a doughnut chart in LibreOffice, after save and reload, the order of its circles become reversed.

Steps to Reproduce:
    1. click on insert toolbar, select chart
    2. right click on the chart, select chart type
    3. select pie, select donut
    4. click on the outer circle, right click, select insert data labels
    5. save and reload

Actual Results:
Outer circle(s) become inner circle(s).

Expected Results:
Do not change the order of circles.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 NISZ LibreOffice Team 2019-02-07 08:31:10 UTC
Created attachment 148969 [details]
Screenshot of the problem in Writer with the expected result (above) and the wrong result after filesave and reload (below).
Comment 2 NISZ LibreOffice Team 2019-02-07 08:31:34 UTC
Created attachment 148970 [details]
Example file from Word with the wrong circle order.
Comment 3 NISZ LibreOffice Team 2019-02-07 08:31:52 UTC
Created attachment 148971 [details]
The original odt file from Writer with the right circle order. (The docx file should look like this).
Comment 4 NISZ LibreOffice Team 2019-02-07 13:42:41 UTC
Created attachment 148979 [details]
mso example docx file with lo doughnut chart default values datatable
Comment 5 NISZ LibreOffice Team 2019-02-07 13:43:10 UTC
Created attachment 148980 [details]
comparing mso and lo behavior with lo doughnut chart default datatable values
Comment 6 Luke 2019-02-09 20:54:27 UTC
Created attachment 149061 [details]
Naive Excel correctly Roundtrips

This is tricky because LO's default order is outer to inner, while MSO's order is inner to outer order. We already correctly round trip MSO docs preserving the order. We only want to swap the order when converting ODF to OOXML

The order is preserved even if you take an MSO doughnut, imported it to ODF, and then exported it to back to OOXML. The only case that is broken is when you start as ODF. Is there some compatibility flag that needs to be set or checked?  Both XLS and XLSX are affected.
Comment 7 Luke 2019-02-09 20:55:15 UTC
Created attachment 149062 [details]
Native Calc shows XLS and XLSX affected
Comment 8 Adam Kovacs 2019-02-12 11:02:13 UTC
Some results:

If you reverse this loop...
(like this:
for( sal_Int32 nSeriesIdx= rSeriesSeq.getLength()-1; nSeriesIdx<=0; --nSeriesIdx ))
...then the order of circles will be reversed after every filesave (and reload).
https://opengrok.libreoffice.org/xref/core/oox/source/export/chartexport.cxx?r=82b91027#1941

There is a member function about the view in piechart.cxx:
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/PieChart.cxx?r=033ebc5a#390
which is working this way:
https://opengrok.libreoffice.org/xref/core/chart2/source/view/inc/VSeriesPlotter.hxx?r=40144617#134
...it can be a related stuff.
Comment 9 Adam Kovacs 2019-02-12 11:52:21 UTC
If this bug is fixed, it probably fix this also:
https://bugs.documentfoundation.org/show_bug.cgi?id=108067
Comment 10 Commit Notification 2020-08-24 10:08:30 UTC
Tünde Tóth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/22cd7d8b679d238559820d3c4cd5ff0b9153ffce

tdf#123218 tdf#108067 config key ReverseXAxisOrientationDoughnutChart

It will be available in 7.1.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 11 NISZ LibreOffice Team 2020-08-25 10:10:46 UTC
No backport needed since the commit adds a config key.
Comment 12 NISZ LibreOffice Team 2020-09-14 09:48:14 UTC
Verified in:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 34a09c9c61bff30e8c4d16132bb47b2b1b16e422
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded