Apache OpenOffice (AOO) Bugzilla – Issue 79009
Charts in Writer loose connection to table in old versions
Last modified: 2013-02-24 21:22:05 UTC
Create a chart from an entire writer table, save the document and load it in OOo 2.2.1 or earlier (Even StarOffice 7 with ODF filter shows this behavior): the chart does no longer get updates of data in a table even with F9 or the "Update all Charts" function. The problem are the ranges that are written in the content.xml stream of the chart. The ranges have ever since been wrong (the row number was one too large). In m217 this is fixed, i.e. the range is written correctly, however loading fails. Suggested fix: Write the ranges wrong again, so that loading works in older versions. Also implement a check using versioning (possible since charts have their own meta stream). To fix ranges only for existing versions of OOo, so that a fixed range in a document created with OOo 2.4 or 3.0 will be read correctly in OOo 2.3.
->TL: Please pass an Argument "BrokenCellRangeForExport" (or sth. like that) in the XDataProvider::detectArguments() method that contains the same as "CellRangeRepresentation" only that all rows that appear there are one too large. It is always the rows, no matter if data was taken from rows or columns.
Created attachment 46721 [details] Document created with old chart showing the wrong ranges for data from columns and from rows
Note that with the mentioned approach the range must be convertible by the XRangeXMLConversion, even if it overlaps the table boundaries. If this is not possible, we have to use a different approach.
xmloff/source/chart/SchXMLExport.cxx now uses the value of the argument "BrokenCellRangeForExport" if it is available for export at the plot-area. Otherwise it exports "CellRangeRepresentation" like before.
Fixed in CWS chart07. Files changed: - unochart.hxx - unochart.cxx
TL->BM: Seems to work. Please have a look.
Not fixed. This is how the range is converted to be "broken": orig: "Table1.$A$1:.$C$3" broken: "Table1.A2:C4" The "$"s are missing, and the "." before the end-cell is missing. The latter leads to losing label information in the old chart.
Trying to fix.
-TL: As I expected the range conversion does not work. I explicitly asked you if that was a problem (even mentioned in this issue), and that we would need a different approach if it was. Why did you set this issue to fixed when it obviously doesn't work. I would expect a developer to do at least one test before setting an issue to fixed.
I removed the check for valid cells. ->TL: Maybe this was a misunderstanding, it seems like you implemented the validity check in the range conversion explicitly for this issue. Please confirm that it is ok to remove it, i.e. no other fix needs this. (see diff between 1.3.32.7 and 1.3.32.8 of unochart.cxx).
->mru: Please verify in CWS chart07 (or send to kla, if there is no time). Test: create a chart using a writer table using a range compatible to the old behavior, i.e. only one range spanning a rectangular sub-range of a table. Save, and reload in a version prior to SRC680.m212, i.e. containing the old chart. Change a value, press F9, the chart should get the new value.
Er, addition for the test note: Of course the "trivial subrange", i.e. the complete table should also work :-)
Verified in CWS chart07.
Checked in 680m224.