Bug 114179 - FILEOPEN DOCX Custom size and position of the chart wall is not interpreted in DOCX files created with Word 2013
Summary: FILEOPEN DOCX Custom size and position of the chart wall is not interpreted i...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0
Keywords:
: 108103 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-30 15:24 UTC by Gabor Kelemen (allotropia)
Modified: 2019-01-08 13:47 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file made with Word 2013 (30.12 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-11-30 15:24 UTC, Gabor Kelemen (allotropia)
Details
The example file saved by LO6 alpha (21.58 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-11-30 15:25 UTC, Gabor Kelemen (allotropia)
Details
The two files in Word and Writer side by side (104.85 KB, image/png)
2017-11-30 15:25 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-11-30 15:24:49 UTC
Created attachment 138139 [details]
Example file made with Word 2013

The Custom size and position of the chart wall is not interpreted in DOCX files created with Microsoft Word 2013.

Steps to reproduce:
1. Create a new document in Microsoft Word 2013.
2. Create a simple chart (a column chart with default settings will do) with the default values.
3. Change the size of the chart wall and move it a bit.
4. Save the file as DOCX.
5. Open the file with LibreOffice Writer.

Actual results:
The size of the chart wall will revert to default.

Expected results:
The custom size of the chart wall should be preserved.
Comment 1 Gabor Kelemen (allotropia) 2017-11-30 15:25:24 UTC
Created attachment 138140 [details]
The example file saved by LO6 alpha
Comment 2 Gabor Kelemen (allotropia) 2017-11-30 15:25:52 UTC
Created attachment 138141 [details]
The two files in Word and Writer side by side
Comment 3 raal 2017-12-02 11:08:11 UTC
I can confirm with Version: 6.1.0.0.alpha0+
Build ID: aa28b54ab568fb7160095bb4a2fec338b1398b43
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3; 

in 4.1 is the file empty.
Comment 4 Bartosz 2018-07-21 22:19:52 UTC
I have analysed the root cause of problem, and it seems that size of the Diagram Shape is not known.
The corresponding source code is located at:
oox/source/drawingml/chart/plotareaconverter.cxx:422

in method:
void PlotAreaConverter::convertPositionFromModel()

THe condition:
    if( aLayoutConv.calcAbsRectangle( aDiagramRect ) ) try

is not met, as calcAbsRectangle doesn't have information about position and size of diagram.
Unfortunately I was not able to find how to receive these information.

Maybe shape size should be taken as it was done for Area property:
https://gerrit.libreoffice.org/#/c/57762/5/oox/source/drawingml/chart/titleconverter.cxx
Comment 5 Gabor Kelemen (allotropia) 2018-07-22 19:43:38 UTC
(In reply to Bartosz from comment #4)
> I have analysed the root cause of problem, and it seems that size of the
> Diagram Shape is not known.

There is this piece of xml in the original files word/charts/chart1.xml that looks relevant:

<c:manualLayout><c:layoutTarget val="inner"/><c:xMode val="edge"/><c:yMode val="edge"/><c:x val="0.4291878098571012"/><c:y val="0.41305555555555556"/><c:w val="0.46664552347623223"/><c:h val="0.34062148481439819"/></c:manualLayout>

Of course the file saved by LO lacks this. 
Maybe parsing this is the direction to go?
Comment 6 Commit Notification 2018-11-16 17:32:19 UTC
Jozsef Szakacs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#114179: Custom size and position of the chart wall

It will be available in 6.2.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 7 Balázs Varga 2019-01-08 13:47:38 UTC
*** Bug 108103 has been marked as a duplicate of this bug. ***