Bug 77352 - Copying cell range with chart results in incorrect clipboard, unless sheet renamed from "Sheet1"
Summary: Copying cell range with chart results in incorrect clipboard, unless sheet re...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.3.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Images Chart-Data Cut-Copy
  Show dependency treegraph
 
Reported: 2014-04-11 23:18 UTC by panoworks
Modified: 2020-07-07 07:58 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
example of chart copying (21.29 KB, image/png)
2014-04-11 23:18 UTC, panoworks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description panoworks 2014-04-11 23:18:11 UTC
Created attachment 97246 [details]
example of chart copying

When copying a range of cells, objects within that range - such as charts - are copied as well.  In Windows, this copies not just LibreOffice data but also bitmap data which can be pasted in most graphics programs.
This is useful mostly when wanting to quickly copy/paste overlapping charts, as the standard 'Export as Image...' only applies to a single chart, and alternative means (screenshots, printing to a bitmap printer, etc.) are cumbersome as well and have their own issues (e.g. copying a selected chart directly copies it without any anti-aliasing).

Unfortunately, something appears to have broken here recently.  Repro steps:
1. Create a simple table, e.g.
Thing | Amount
A     | 1
B     | 2
C     | 3
D     | 4

2. Create a chart for that table.  A pie chart will do.
This should appear as a standard pie chart with green, yellow, orange and blue sections.

3. select the cells that contain the chart.
4. copy the selection to clipboard
5. paste into a graphics program
The pie chart itself is not visible, while the legend shows completely different colors (irfanview) or the correct colors (mspaint - but still no actual chart), or fails to paste entirely (GIMP).

Example image attached.

Potentially related: Bug 60443, Bug 61405 - though those deal in part with pasting into LibreOffice documents.
Comment 1 raal 2014-10-06 19:50:35 UTC
I can not confirm with LO  4.3.2.2 (ID build: edfb5295ba211bd31ad47d0bad0118690f76407d), Windows 7.
Copy paste chart to mspaint is correct.
Comment 2 panoworks 2014-10-06 20:45:28 UTC
Thanks for the reminder to check this.

4.3.2.2 (edfb5295ba211bd31ad47d0bad0118690f76407d), can still confirm actual chart is missing here - only the legend (minus text) pastes.  But at least the odd color issue disappeared (not being able to paste in Gimp shifted to happening when copying the chart object itself - will open a different bug report if required).

-----

I decided to check out the clipboard data, just in case Gimp et al were being silly, using:
http://www.nirsoft.net/utils/inside_clipboard.html

When copying cells with chart, I get output on several seemingly graphics-related clipboard streams:
CF_DIB: Mostly FF values, coinciding with the white of the chart.
PNG: Saved as binary, shows no chart.
Windows Bitmap: Mostly FF values (saved as binary, shows no chart)
GDIMetaFile: Unsure - apparently one of the few formats irfanview will not open or recognize.

-----

Some additional info:
O/S: Windows 8

- Other charts elements do appear to copy (title, subtitle, axes labels, axes, major/minor grid).
- In most chart types, the legend's text does appear.
- In the 'net' type of chart, the net title does not appear.
- In a pie chart (any subtype), if I change the legend to appear at the top/bottom and make some of the label data longer, the legend's color squares get further apart to make room for the text.  However, in the pasted version, they are all spaced closely together (i.e. as if the chart is re-generated for the clipboard specifically, and has the text (and pie slices) missing entirely).

Any other things I could try / information I could provide?
Comment 3 raal 2014-10-07 17:36:00 UTC
I can not confirm with LO  4.3.2.2 (ID build: edfb5295ba211bd31ad47d0bad0118690f76407d), Windows 7 64bit.
Copy paste chart to mspaint is correct.

But I can confirm with LO 4.3.2.2 portable (portableapps.com), windows 7 32bit
Copy paste chart to mspaint is incorrect - no chart.

I can confirm with Version: 4.4.0.0.alpha0+
Build ID: ced24ffba2fa1754c466b7944b0ee06d21292706
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-10-04_21:31:09
Copy paste chart to gimp is incorrect - no chart.

I can not confirm with LO 4.2.6.3, Linux
Copy paste chart to gimp is correct.

Setting as NEW.
Comment 4 panoworks 2014-10-07 18:58:38 UTC
Glad you could confirm!  I figured I should check if this issue also happens in AOO - it doesn't.  That led me to checking out bug fix lists, and it looks  like this bug from AOO is relevant:
https://issues.apache.org/ooo/show_bug.cgi?id=118840

I can also confirm what is mentioned in there - renaming the sheet that the graph is on to anything other than "Sheet1" appears to cause the bug to be avoided.  We never rename it, as the first sheet is designated our 'scratch pad' sheet.

At least that's a work-around.  If you feel that this new information should lower the Importance, you'd get no complaint out of me :)
Comment 5 QA Administrators 2015-10-14 19:56:35 UTC Comment hidden (obsolete)
Comment 6 panoworks 2015-11-16 14:16:33 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-01-03 19:35:28 UTC Comment hidden (obsolete)
Comment 8 panoworks 2017-01-04 12:29:37 UTC
LibreOffice
Version: 5.2.4.2
Build ID: 3d5603e1122f0f102b62521720ab13a38a4e0eb0
CPU Threads: 8; OS Version: Windows 6.2; UI Render: default; 
Locale: en-US (en_US); Calc: group

OS: Windows
Version: 8, 64-bit

Bug still present.
Renaming the sheet still a workaround.
Comment 9 QA Administrators 2018-07-05 02:49:29 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2020-07-05 03:39:12 UTC Comment hidden (obsolete)
Comment 11 Timur 2020-07-07 07:58:16 UTC
I cannot confirm this ever worked (not marked regression anyway) but I reproduce in Lo 7.1+ with rename workaround.