Apache OpenOffice (AOO) Bugzilla – Issue 114089
all charts in existing (spreadsheet) documents broken after programmatically creating a chart
Last modified: 2017-05-20 10:22:27 UTC
- open the attached document - press the contained button, or manually execute the "createDoc" macro in the document => a spreadsheet document is created, containing a simple chart object - close the newly created document - open *any* spreadsheet document which contains a chart => the chart in the document displays a completely white placeholder. Activating the chart shows that all the data is lost (no matter whether it was contained in the chart, or taken from the surrounding spreadsheet doc) - restart OOo - open the spreadsheet doc, again => the chart is read and displayed correctly
worked in OOo 3.1.1, already broken in OOo 3.2.1
Created attachment 71319 [details] document to reproduce the bug case
fs->cl: That's the problem of all SvxShape instances of the same type sharing a common property "cache", instead of sharing only the structure needed for mapping between properties and items. In particular, with creating the chart shape via API, the property map created via SvxUnoPropertyMapProvider::GetMap(SVXMAP_OLE2) gets a CLSID property set. Upon loading the other spreadsheet, this very same property map, with a cached CLSID property, subtly changes the control flow in SvxShape::ObtainSettingsFromPropertySet, called from SvxShape::Create. This way, an embedded object is created prematurely, instead of creating it later, and loading it from the document package.
.
setting target 3.3
this issue was introduced 1-2 years ago during a performance optimization. The correct fix would be to not cache the SvxItemPropertySet. But this disables all performance optimization and has some potential side effects. Therefore I will not fix this bug completly for OOo 3.3. I added changes that the properties are cleared as soon as the shape itself is inserted into any slide. Therefore this bug will still happen if someone creates two or more shapes of the same type and set properties before adding them. The more often used case with sequential creation and adding will now work. The preferred way would be to insert the shape before doing anything with it. I have created follow up issue 114206 for a more complete fix later
verified in cws impress200, back to qa
verified in internal build cws_impress200