Comment 8 for bug 249445

Revision history for this message
codedread (codedread) wrote :

This is a new patch that obsoletes my first patch. The new patch (#2) also:

- fixes a segfault (group's write was not creating a svg:g in Plain SVG case)
- updates several SPObject type write methods that I missed the first time (flowRegion, flowRoot, flowPara, flowTspan, etc)

So the problem that I see it now with the patch that I've implemented is:

- item does all the serializing of child objects (for both Plain SVG and Inkscape SVG), whereas before SPObject subclasses would only specify the types of children it could have in Plain SVG mode
- for instance, before my patch, flowDivs would only allow: flowTSpan, flowPara or strings for Plain SVG
- after my patch, all children types are allowed for flowDivs
- this is why I've left that code in the various write methods and simply commented it out (not convinced I should be removing it)

We want object types to be able to say what child types are allowed in Plain SVG mode (we just don't want to add a loop in every subclass that will specifically allow <title> and <desc> children).

I think the only solution is to restore the child-looping code in the subclasses that have it but also add child-looping code into sp-item that explicitly allows <title> and <desc> to be prepended. This means we loop over the children twice for those types that have other types of children outside of <title> and <desc>. Not too big of a deal tho.

Will work on this and submit a subsequent patch (#3).