Bug 111636

Summary: Copying chart into Calc or Writer result wrong X/Y axis
Product: LibreOffice Reporter: Dimitri Bouron <bouron.d>
Component: ChartAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: rb.henschel, xiscofauli
Priority: medium    
Version: 6.0.0.0.alpha0+   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Test file

Description Dimitri Bouron 2017-08-10 13:38:40 UTC
Description:
X/Y axis of chart are modified after copy from Calc to Writer or Calc.
Thus, chart doesn't look like original one.
It is probably axis unit formats which are badly copied.
Data seems to be preserved.

Steps to Reproduce:
1. In attachment, copy chart or select range which contains chart.
2. Open a new tab or a new Writer document.
3. Paste it.

Actual Results:  
X axis unit is date format instead of numeric.
Y axis unit is decimal format instead of percentage.
Columns are misrepresented due to these changes.

Expected Results:
Correct X/Y axis unit formats.


Reproducible: Always

User Profile Reset: No

Additional Info:
In file sc/source/core/data/drwlayer.cxx, in function ScDrawLayer::CopyToClip, if you change this line:

SdrObject* pNewObject = pOldObject->Clone();
by SdrObject* pNewObject = pOldObject->getFullDragClone();

You have a correct chart only when you copy your chart by selecting a cell range, including the chart. But, you copy an image, not an editable chart.

Maybe we can understand what is the difference between these function and how they work?


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0
Comment 1 Dimitri Bouron 2017-08-10 13:39:09 UTC
Created attachment 135414 [details]
Test file
Comment 2 Regina Henschel 2017-08-10 18:06:48 UTC
When you copy a chart, the chart loosed the connection to the data in the spreadsheet. The values are copied to a table inside the chart. But this internal table has no formatting for its values. In case you have checked the option "Source format" in tab Numbers in the properties of an axis, that cannot work, because the connection to the spreadsheet no longer exists.
Uncheck that option and style your axes manually. Then try copy&paste again.
Comment 3 Xisco FaulĂ­ 2017-08-15 16:59:54 UTC
Closing as RESOLVED NOTABUG as per comment 2
Comment 4 Dimitri Bouron 2017-08-16 08:13:50 UTC
(In reply to Regina Henschel from comment #2)
> Uncheck that option and style your axes manually. Then try copy&paste again.

Thank you for the answer. Indeed, it works.