Estimated read time: 2 minutes
Shape properties were shared by shape type (e.g. shared between group shapes) before insertion into a document model in Impress. This is now fixed: the property names and types are still shared to help performance, but their values are no longer shared. This helps matching the user expectation that separate opened documents don’t share information with each other.
I was working on a testcase for tdf#132696 when I noticed that the existing CppunitTest_oox_drawingml testsuite runs fine before my changes, also a newly added testGroupShapeSmartArt testcase runs fine in isolation, but if I run the whole testsuite, then it breaks.
Further investigation revealed that in case testGroupShapeSmartArt is executed first, then testTdf131082 fails. This means:
the first document is opened
the first document is closed
the second document is opened
the second document is saved
And at this point information from the first document is leaked to the second document, even if the first document was already closed by the time we performed the save. It turns out the root cause was i#114206 (reported in 2010), i.e. group shapes shared their property values till they got inserted to the document model. The first document import did not consume pending SmartArt properties on a to-be-inserted group shape, the second import was looking for pending properties, found them. And then the second document’s save wrote those pending properties to the file, leading to this unexpected leak.
Here is how the first document looks like, containing the blue rectangles (a SmartArt):
Here is how the second document looks like, without a SmartArt:
And here is how the second document looks, after saving to PPTX and reloading:
Results so far
The fix is to
split out part of
SvxItemPropertySet to a separate class, so that we can keep sharing
SvxItemPropertySet between multiple instances of the same shape type (describing the name and type
of the various properties), while introducing a new
SvxItemPropertySetUsrAnys that is specific to
each not-yet-inserted shape. This way each pending shape is independent, and in case they are not
inserted to the document model later, that results in no side-effects.
Want to start using this?
Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF’s next release (7.3).