Issue 114089 - all charts in existing (spreadsheet) documents broken after programmatically creating a chart
Summary: all charts in existing (spreadsheet) documents broken after programmatically ...
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: OOO330m5
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: oc
QA Contact: issues@framework
Keywords: regression
Depends on:
Blocks: 111112
  Show dependency tree
Reported: 2010-08-24 14:27 UTC by Frank Schönheit
Modified: 2017-05-20 10:22 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

document to reproduce the bug case (10.08 KB, application/vnd.oasis.opendocument.text)
2010-08-24 14:30 UTC, Frank Schönheit
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2010-08-24 14:27:57 UTC
- open the attached document
- press the contained button, or manually execute the "createDoc" macro in the
=> 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
Comment 1 Frank Schönheit 2010-08-24 14:30:29 UTC
worked in OOo 3.1.1, already broken in OOo 3.2.1
Comment 2 Frank Schönheit 2010-08-24 14:30:51 UTC
Created attachment 71319 [details]
document to reproduce the bug case
Comment 3 Frank Schönheit 2010-08-24 14:37:17 UTC
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.
Comment 4 Oliver Brinzing 2010-08-24 16:06:40 UTC
Comment 5 oc 2010-08-25 14:39:03 UTC
setting target 3.3
Comment 6 clippka 2010-08-30 15:02:40 UTC
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
Comment 7 clippka 2010-08-30 15:03:49 UTC
verified in cws impress200, back to qa
Comment 8 oc 2010-09-01 12:23:06 UTC
verified in internal build cws_impress200