Apache OpenOffice (AOO) Bugzilla – Issue 88591
Charts with empty cells change aftercopy/paste from Calc to Writer
Last modified: 2013-02-24 21:22:18 UTC
I have produced multiple diagrams in OO calc. Each diagramm is an x-y diagram with 4 data sets. each data set has a different length, like 575 or 801 rows. when copying these good looking diagrams from calc to writer, writer fills up every short row to the maximum row length with zeros. this would mean 226 zero zero rows in the above example. the result is an unaesthetic line to (0,0). I can send you an example file if necessary.
Please attach a sample document
Created attachment 53228 [details] just see
Yes, from the document I can see that the empty data fields are filled with zero values. I need to replicate the way to this result. Could you please attach you ods (spreadsheet) document to this issue? When I create something similar with my own test files the empty cells will remain - and not be filled with zero's...
Created attachment 53240 [details] 4x4 data sets all with the same problem. data ranges for diagrams were created manually
Thanks malinalda for the quick response. With the attached document this is reproducible. MRU->IHA: The empty cells of the spreadsheet are transferred as zero values to the Chart when it is copied into Writer. See attached ods file. On the table "Graphen" copy the first chart from Calc into Writer and see that the chart lines flow back into the origin.
@weiz, please analyze where the empty values are wrongly replaced with zero
*** Issue 89427 has been marked as a duplicate of this issue. ***
->iha: The patch for this issue is finished. Please let me know if you have any suggestions. Thank you!
Created attachment 53833 [details] patch_080522
@weiz, I compiled and tested the patch but the problem still exists. Did you maybe attach not the complete patch?
->iha: It's the complete patch, and it's OK in my test cases. If you use the example document "Messwerte E103.ods" to test the patch, you should click into the chart before you copy it, as the empty values are already replaced with zero in file "content.xml", so we need to rewrite the values to empty. The step above is unnecessary for the charts that new create.
Ah yes great, it works fine! :-) . And its good to mention here that a special handling is needed for older documents. Cool that you found that place where the problem is caused! And the patch is absolute correct. Only there is a possibility to make the fix more elegant. Instead of setting a default value to each element of a vector after resizing it, you can use the resize method with two parameters where the second parameter is the value with which inserted elements are initialized. I have changed the code accordingly and will attach a patch.
Created attachment 54249 [details] patch2
Fixed in CWS chart27.
@Thomas, please verify in CWS chart27. For all old files including the attached one it is necessary to double click the chart once before copying. Updateing the charts via F9 before copying works also. Newly created charts should behave fine directly now.
seen ok in cws chart27 -> verified
seen ok in current master -> closed