Bug 58562 - EDITING: copy and paste of CHART from Calc looses Y values
Summary: EDITING: copy and paste of CHART from Calc looses Y values
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta1
Hardware: Other Windows (All)
: highest normal
Assignee: Kohei Yoshida
QA Contact:
URL:
Whiteboard: BSA bibisected40 target:4.1.0 target:...
Keywords: regression
: 59175 59624 (view as bug list)
Depends on:
Blocks: mab4.0 59335
  Show dependency treegraph
 
Reported: 2012-12-20 10:29 UTC by Gaetano Giunta
Modified: 2013-02-05 16:35 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot with pasted graph (15.92 KB, image/jpeg)
2012-12-20 10:29 UTC, Gaetano Giunta
Details
Test kit with source and target document (32.07 KB, application/zip)
2012-12-20 12:14 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gaetano Giunta 2012-12-20 10:29:57 UTC
Created attachment 71844 [details]
screenshot with pasted graph

Problem description: 

Steps to reproduce:
1. create a graph in calc
2. copy and paste it to writer

Current behavior:
object is pasted, but no data is present: no data lines shown, no title for graph lines

Expected behavior:
object is pasted correctly (graph looks in writer as it does in calc)

              
Operating System: Windows 7
Version: 4.0.0.0.beta1
Last worked in: 3.6.4.3 release
Comment 1 Rainer Bielefeld Retired 2012-12-20 11:53:41 UTC
[Reproducible] with parallel installation of  "LOdev  4.0.0.0.beta1   -  GERMAN UI / German Locale  [Build ID: 87906242e87d3ddb2ba9827818f2d1416d80cc7)]"  {tinderbox: @6, pull time 2012-12-06} on German WIN7 Home Premium (64bit) with separate /4 User Profile for Master Branch

I created a simple chart in a spreadsheet, and when I copy / paste (context menu) it to Draw or Writer, Y-Data will be missing in the chart data table.

Copy Paste of charts created in Draw or Writer are not affected.
Comment 2 Rainer Bielefeld Retired 2012-12-20 12:11:02 UTC
Still [Reproducible] with 
* server  installation of  "LOdev  4.0.0.0.beta1+   -  ENGLISH UI / German Locale  [Build ID: 6d4a55bf38a1c470c49f904dbbddf94eb2f6154)]"  {tinderbox: Win-x86@6, pull time 2012-12-17 08:36:40} on German WIN7 Home Premium (64bit) with own separate User Profile 

Already [Reproducible] with 
* with unzipped  installation of  "LOdev  4.0.0.0.alpha1+   -  ENGLISH UI / German Locale  [Build ID: af60316514f3ae3d4c475819bf86f2af837171e)]"  {tinderbox: Win-x86@6, pull time 2012-11-23 22:10:31} on German WIN7 Home Premium (64bit) with own separate User Profile 

Still was OK with
* Server-installation of Master "3.7.0.alpha0+  – ENGLISH UI [Build ID: f2e622]" {tinderbox: Win-x86@16, pull time 2012-10-06 09:31:39} on German WIN7 Home Premium (64bit) UserInstallation=$SYSUSERCONFIG/LOdev/3

@Spreadsheet Team:
Please set Status to ASSIGNED and add yourself to "Assigned To" if you accept this Bug or forward the Bug if it's not your turf (and remove others in team from CC).
Comment 3 Rainer Bielefeld Retired 2012-12-20 12:14:21 UTC
Created attachment 71849 [details]
Test kit with source and target document

For a quick test
Comment 4 Rainer Bielefeld Retired 2012-12-20 12:46:01 UTC
Same time range where the problem started like for Bug 58571 - Invalid ODF 1.2: " tag name "text:p"", coincidence or relation?
Comment 5 Ruslan Kabatsayev 2013-01-10 16:45:51 UTC
*** Bug 59175 has been marked as a duplicate of this bug. ***
Comment 6 Rainer Bielefeld Retired 2013-01-10 18:39:31 UTC
For Bibisedt Details please see  Attachment 72752 [details] for Bug 59175 (from where I transferred Bibisect whiteboad tag)
Comment 7 Ruslan Kabatsayev 2013-01-13 11:52:42 UTC
Setting priority according to description in bug 59175:
Normal - Can make high quality work substantially harder to accomplish
Highest - Regression
Comment 8 Markus Mohrhard 2013-01-14 03:48:36 UTC
Ah it should block 59335
Comment 9 Kohei Yoshida 2013-01-16 04:40:06 UTC
Interesting thing is, when copy and pasting from sheet whose name is not 'Sheet1', the data is preserved.  When copying a chart from sheet named Sheet1, the data is gone after the paste....
Comment 10 Jean-Baptiste Faure 2013-01-16 05:34:35 UTC
(In reply to comment #9)
> Interesting thing is, when copy and pasting from sheet whose name is not
> 'Sheet1', the data is preserved.  When copying a chart from sheet named
> Sheet1, the data is gone after the paste....

Hi Kohei, 
Maybe linked to bug 58988 : Copy and paste chart fails if the source sheet does not have the default name.

Best regards. JBF
Comment 11 Kohei Yoshida 2013-01-17 03:23:44 UTC
I'll take this.
Comment 12 Kohei Yoshida 2013-01-17 04:56:20 UTC
My preliminary fix still had issues.  Back to the drawing board.
Comment 13 Kohei Yoshida 2013-01-17 15:43:49 UTC
Found a better approach.  Working toward that as we speak.
Comment 14 Kohei Yoshida 2013-01-18 19:54:29 UTC
While the automatic bot has trouble posting to multiple bugs if a single commit references more than one bug, this commit

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c55d52262ea1d5f869a9528fd051ee19e687f1cc

fixes this bug as well (as indicated in the title line).
Comment 15 Ruslan Kabatsayev 2013-01-19 09:59:40 UTC
I confirm this is fixed in master. Is this commit also in 4-0?
Comment 16 Markus Mohrhard 2013-01-19 10:23:06 UTC
(In reply to comment #15)
> I confirm this is fixed in master. Is this commit also in 4-0?

No. I still have to review the fix for 4.0.
Comment 17 Ruslan Kabatsayev 2013-01-20 14:49:16 UTC
@Kohei Yoshida
Despite this bug being fixed for Writer, this still appears to reproduce with Calc. Namely, if you copy a chart on "Sheet 1" to clipboard and try to paste it into a new spreadsheet, you'll get empty chart. If you copy it from another sheet, it copies OK.
At the same time, if you copy the chart from any sheet to Writer (which works OK) and then copy from Writer to Calc, it also works.
Comment 18 Ruslan Kabatsayev 2013-01-20 14:50:01 UTC
Well... it appears to depend on order of copying:
a)Works:
1. Copy to clipboard
2. Paste to Writer
3. Paste to Calc
b)Doesn't work:
1. Copy to clipboard
2. Paste to Calc (get empty chart)
3. Paste to Writer (also empty)
Comment 19 Rainer Bielefeld Retired 2013-01-20 16:20:01 UTC
(In reply to comment #17)
@Ruslan Kabatsayev:
I think you made a mistake in the reasoning in your test when you copied the chart to a different Calc document, 

Yes, chart is empty, but the reason is that if you copy a chart from a sheet with default name to a sheet with same default name in an other document, the data ranges will refer to the same named cells in the new document (other bug, I just do not know the ID). 

You should see the data range borders around the cells after a double click on the chart in the new document.
Comment 20 Ruslan Kabatsayev 2013-01-20 16:42:52 UTC
(In reply to comment #19)
OK, the data ranges are indeed present in the chart pasted from Calc to Calc.
But what about b) in comment #18? Once pasted to calc, the chart in clipboard appears corrupt or whatever, which makes it impossible to paste in Writer. Should this be considered that same bug you're referring to?
Comment 21 Rainer Bielefeld Retired 2013-01-20 17:38:01 UTC
Reported problem now works fine with server installation of  "4.1.0.0.alpha0 (Build ID: 072fc07107e9849ed7050d18575b42049db9657) TinderBox: Win-x86@6, Branch:master, Time: 2013-01-19 22:38:36  - ENGLISH UI / German Locale  on German WIN7 Home Premium (64bit) with LO41 Masters User Profile, other observations in #19 (from 4.0.0.1) exactly the same.

(In reply to comment #20)
@Ruslan Kabatsayev
Your description is a little imprecise, I added some more details to your "b" for a test with a.m. Version

1. Click on chart in source document
2. <control+c> for copy
3. Menu 'file -> New -> Spreadsheet'
4. Click into A1
5. <control+v> for paste
   > Chart shown empty as discussed
6. Menu 'file -> New -> Writer document'
7. Click into new document
8. <control+v> for paste
   As Expected chart with contents shown

Or may be you forgot to mention a step
b2.1. <control+c> for copy new chart?

Of course if you copy an empty chart the pasted result will be an empty chart.
Comment 22 Ruslan Kabatsayev 2013-01-20 17:47:23 UTC
(In reply to comment #21)
> Or may be you forgot to mention a step
> b2.1. <control+c> for copy new chart?
Nope. My point is that once you paste the chart to Calc, which pastes as empty, it somehow replaces(?) clipboard contents and next time you paste (that firstly copied chart) to Writer, you now get the new, empty one.
So, my instructions are as follows:
1. Click chart on Sheet1
2. Ctrl+C
3. File->New spreadsheet
4. Ctrl+V in newly opened window (which has Sheet1 as default)
5. File->New text document
6. DON'T copy again! Ctrl+V in newly opened window
7. Results of steps 4 and 6 are the same - empty chart in BOTH windows.
At the same time, if you skip step 4, you get correct chart in step 6.
So, Ctrl+C is only in step 2.
Comment 23 Rainer Bielefeld Retired 2013-01-20 18:23:24 UTC
*** Bug 59624 has been marked as a duplicate of this bug. ***
Comment 24 Eike Rathke 2013-01-21 20:31:03 UTC
Bot didn't add this, so:

Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1ecb30cede30fea5a6a239d3d8da8ebbf8b79bf9&h=libreoffice-4-0

fdo#58988, fdo#58562: Populate draw clip document with data for charts.


It will be available in LibreOffice 4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 25 Clemens Eisserer 2013-01-22 17:56:42 UTC
Still reproduceable with  build ID 1ecb30cede30fea5a6a239d3d8da8ebbf8b79bf. Is it supposed to have the fix?
Comment 26 Kohei Yoshida 2013-01-23 17:09:04 UTC
(In reply to comment #17)
> @Kohei Yoshida
> Despite this bug being fixed for Writer, this still appears to reproduce
> with Calc. Namely, if you copy a chart on "Sheet 1" to clipboard and try to
> paste it into a new spreadsheet, you'll get empty chart. If you copy it from
> another sheet, it copies OK.
> At the same time, if you copy the chart from any sheet to Writer (which
> works OK) and then copy from Writer to Calc, it also works.

I *swear* this scenario worked at the time I committed this as of last week, but now I pulled and re-built latest master the problem is there.

What's going on!?
Comment 27 Rainer Bielefeld Retired 2013-01-23 17:46:59 UTC
(In reply to comment #26)
I don't think that that has to do with this one, what is fixed for server installation of  "Version 4.1.0.0.alpha0+ (Build ID: 9d7544b7502f27b961115ef9ad373b5e570d0dd) TinderBox: Win-x86@6, Branch:master, Pull Time: 2013-01-22_04:56:24" ENGLISH UI / German Locale  on German WIN7 Home Premium (64bit) with LO41 Masters User Profile. I just tested again.

The scenario in your citation might be be something in the area of Bug 58988. I am pretty sure that I saw a sheet name related problem different to the one there  (but probably related), unfortunately I forgot what I had done.

Or simply the problem I mentioned here in Comment 19?

Anything else worked perfectly.
Comment 28 Kohei Yoshida 2013-01-23 19:35:34 UTC
I got it.  Yeah, this actually never worked, and the place where this occurs is deep inside the XML import code (don't ask me why we do this during copy-n-paste) that fixing this will take a bit of creativity.

Let me think about this.
Comment 29 Not Assigned 2013-01-24 03:29:11 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=043e30baedb42dbc8799003ea2ae7987a97871ca

fdo#58562: Ensure internal data is always used when pasting to another doc.



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 30 Kohei Yoshida 2013-01-24 04:42:50 UTC
I've sent a review request to gerrit for 4.0 inclusion.  That should resolve the issue that Ruslan was seeing earlier.
Comment 31 Not Assigned 2013-01-24 10:40:28 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8a4272347298d8e4eab2fd685a4993709d888762&h=libreoffice-4-0

fdo#58562: Ensure internal data is always used when pasting to another doc.


It will be available in LibreOffice 4.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 32 Ruslan Kabatsayev 2013-01-24 11:28:07 UTC
(In reply to comment #29)
I confirm that the whole bug with Writer&Calc is fixed in master. Thanks, Kohei.
Comment 33 Kohei Yoshida 2013-01-24 12:44:20 UTC
Now, this is really fixed.
Comment 34 Not Assigned 2013-01-27 00:21:11 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-0-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2b641b29b55c7e8a08dcbbb10927c354059916bd&h=libreoffice-4-0-0

fdo#58562: Ensure internal data is always used when pasting to another doc.


It will be available already in LibreOffice 4.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 35 tim.topptopp 2013-02-05 16:35:43 UTC
Dear Kohei,

could you please have a look into the following bug which sounds very similar to this but but is not a duplicate and was not resolved by your patch.

https://bugs.freedesktop.org/show_bug.cgi?id=52159


I used this build, which should include your fix, that the bug 52159 is still not fixed:

tinderbox: administrator: fridrich.strba@bluewin.ch
tinderbox: buildname: Linux-x86_10-Release-Configuration
tinderbox: tree: libreoffice-4-0
tinderbox: pull time 2013-02-03 12:48:54
tinderbox: git sha1s
core:9b70bf62e6b5319e282cd3533c90216aabccfe53

regards,
tim